Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ include(cmake/get_nwx_cmake.cmake)
include(get_version_from_git)
get_version_from_git(utilities_version "${CMAKE_CURRENT_LIST_DIR}")
project(utilities VERSION "${utilities_version}" LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

include(nwx_versions)
include(get_cmaize)
Expand Down
10 changes: 5 additions & 5 deletions include/utilities/iterators/input_iterator_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class InputIteratorBase {
* @return true if the two iterators are equal and false otherwise.
* @throws None. No throw guarantee
*/
bool operator==(const ParentType& rhs) const noexcept;
bool operator==(const InputIteratorBase& rhs) const noexcept;

/** @brief Determines if two iterators point to different elements.
*
Expand All @@ -166,7 +166,7 @@ class InputIteratorBase {
* @return false if the two iterators are equal and true otherwise.
* @throws None. No throw guarantee
*/
bool operator!=(const ParentType& rhs) const noexcept;
bool operator!=(const InputIteratorBase& rhs) const noexcept;

protected:
/// Downcasts this to a read-/write-able instance of the derived class
Expand All @@ -187,13 +187,13 @@ ParentType InputIteratorBase<ParentType>::operator++(int) {

template<typename ParentType>
bool InputIteratorBase<ParentType>::operator==(
const ParentType& rhs) const noexcept {
return downcast_().are_equal(rhs);
const InputIteratorBase& rhs) const noexcept {
return downcast_().are_equal(rhs.downcast_());
}

template<typename ParentType>
bool InputIteratorBase<ParentType>::operator!=(
const ParentType& rhs) const noexcept {
const InputIteratorBase& rhs) const noexcept {
return !((*this) == rhs);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/type_traits/type_traits_extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace utilities;
struct Struct1 {
void begin();
void swap(Struct1&);
bool operator!=(const Struct1&);
bool operator!=(const Struct1&) const;
int operator*();
int operator++(int);
int operator[](int);
Expand All @@ -34,7 +34,7 @@ struct Struct1 {
};
struct Struct2 {
using value_type = int;
bool operator==(const Struct2&);
bool operator==(const Struct2&) const;
int operator++();
Struct2* operator->();
int operator--();
Expand Down