Skip to content
Snippets Groups Projects
Commit 008383dd authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Avoid ambiguity in "NamedRange_ == NamedRange_"

Without `NamedRange_::operator==`, in the comparison between two
`NamedRange_` instances `nr1` and `nr2` C++20 would not be able to
choose between `(Range_&)nr1 == nr2` and `(Range_&)nr2 == nr1`.
parent b7b755e0
No related branches found
No related tags found
1 merge request!1501Fixes for gcc 13, clang 16 and C++20
Pipeline #6349970 passed
...@@ -105,6 +105,8 @@ namespace Gaudi { ...@@ -105,6 +105,8 @@ namespace Gaudi {
/// set the name of the range /// set the name of the range
void setName( std::string value ) { m_name = std::move( value ); } void setName( std::string value ) { m_name = std::move( value ); }
// ======================================================================== // ========================================================================
using Base::operator==;
private: private:
// ======================================================================== // ========================================================================
/// the name, associated to the range /// the name, associated to the range
......
...@@ -223,11 +223,6 @@ namespace Gaudi { ...@@ -223,11 +223,6 @@ namespace Gaudi {
if ( &right == this ) { return true; } // RETURN if ( &right == this ) { return true; } // RETURN
return right.size() == size() && std::equal( begin(), end(), right.begin() ); return right.size() == size() && std::equal( begin(), end(), right.begin() );
} }
/// equality with another range type
template <class CNT, class IT>
bool operator==( const Range_<CNT, IT>& right ) const {
return right.size() == size() && std::equal( begin(), end(), right.begin() );
}
/// compare with another container /// compare with another container
template <class ANOTHERCONTAINER> template <class ANOTHERCONTAINER>
bool operator==( const ANOTHERCONTAINER& right ) const { bool operator==( const ANOTHERCONTAINER& right ) const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment