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<char*>)
|
||||
EQUALITY(const std::string&, view<std::string::const_iterator>)
|
||||
@ -43,6 +44,7 @@ EQUALITY(view<std::string::iterator>, const std::string&)
|
||||
|
||||
#undef EQUALITY
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
namespace util {
|
||||
#define OSTREAM(A) \
|
||||
|
3
view.hpp
3
view.hpp
@ -79,6 +79,9 @@ namespace util {
|
||||
auto
|
||||
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<char*>);
|
||||
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>
|
||||
auto
|
||||
|
Loading…
Reference in New Issue
Block a user