Add operator==, operator!= to source_location

This commit is contained in:
Peter Dimov
2022-05-05 03:25:16 +03:00
parent f1a6f9ffd1
commit a7af7efe51
3 changed files with 33 additions and 0 deletions
+9
View File
@@ -115,6 +115,15 @@ public:
# pragma warning( pop )
#endif
inline friend bool operator==( source_location const& s1, source_location const& s2 ) BOOST_NOEXCEPT
{
return std::strcmp( s1.file_, s2.file_ ) == 0 && std::strcmp( s1.function_, s2.function_ ) == 0 && s1.line_ == s2.line_ && s1.column_ == s2.column_;
}
inline friend bool operator!=( source_location const& s1, source_location const& s2 ) BOOST_NOEXCEPT
{
return !( s1 == s2 );
}
};
template<class E, class T> std::basic_ostream<E, T> & operator<<( std::basic_ostream<E, T> & os, source_location const & loc )