view: add inequality operator
This commit is contained in:
parent
09de734185
commit
7786d32ba5
2
view.cpp
2
view.cpp
@ -31,6 +31,7 @@ util::operator== (A a, B b) \
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
EQUALITY(const std::string&, view<const char*>)
|
EQUALITY(const std::string&, view<const char*>)
|
||||||
EQUALITY(const std::string&, view<char*>)
|
EQUALITY(const std::string&, view<char*>)
|
||||||
EQUALITY(const std::string&, view<std::string::const_iterator>)
|
EQUALITY(const std::string&, view<std::string::const_iterator>)
|
||||||
@ -43,6 +44,7 @@ EQUALITY(view<std::string::iterator>, const std::string&)
|
|||||||
|
|
||||||
#undef EQUALITY
|
#undef EQUALITY
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
namespace util {
|
namespace util {
|
||||||
#define OSTREAM(A) \
|
#define OSTREAM(A) \
|
||||||
|
3
view.hpp
3
view.hpp
@ -79,6 +79,9 @@ namespace util {
|
|||||||
auto
|
auto
|
||||||
make_cview (const T&);
|
make_cview (const T&);
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
bool operator!= (view<T>, view<T>);
|
||||||
|
|
||||||
bool operator== (const std::string&, view<const char*>);
|
bool operator== (const std::string&, view<const char*>);
|
||||||
bool operator== (const std::string&, view<char*>);
|
bool operator== (const std::string&, view<char*>);
|
||||||
bool operator== (const std::string&, view<std::string::const_iterator>);
|
bool operator== (const std::string&, view<std::string::const_iterator>);
|
||||||
|
9
view.ipp
9
view.ipp
@ -170,6 +170,15 @@ util::view<T>::operator== (const view<T> rhs) const noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template <typename T>
|
||||||
|
bool
|
||||||
|
util::operator!= (const view<T> a, const view<T> b)
|
||||||
|
{
|
||||||
|
return !(a == b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
template <typename T, size_t N>
|
template <typename T, size_t N>
|
||||||
auto
|
auto
|
||||||
|
Loading…
Reference in New Issue
Block a user