From 6017737861df5f3799ec2538e5fb62fe378a309e Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 31 Jan 2025 12:36:49 +1100 Subject: Add default basic constructor and operator!= to SelectionPosition to ease use. Use default member initializer, constexpr for constructors and equality operators and <, [[nodiscard]] for comparison operators. Add simple unit tests for Selection. Not trying to be exhaustive here, just start the process of adding tests. --- src/Selection.cxx | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/Selection.cxx') diff --git a/src/Selection.cxx b/src/Selection.cxx index 5b99b7c3a..ad63afd70 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -52,13 +52,6 @@ void SelectionPosition::MoveForInsertDelete(bool insertion, Sci::Position startC } } -bool SelectionPosition::operator <(const SelectionPosition &other) const noexcept { - if (position == other.position) - return virtualSpace < other.virtualSpace; - else - return position < other.position; -} - bool SelectionPosition::operator >(const SelectionPosition &other) const noexcept { if (position == other.position) return virtualSpace > other.virtualSpace; -- cgit v1.2.3