Jamba C++ API 8.0.0
Loading...
Searching...
No Matches
pongasoft::Utils::HasNotEqual Concept Reference

Allows to detect whether a type defines operator!= at compile time. More...

#include <Metaprogramming.h>

Concept definition

template<typename T>
concept HasNotEqual =
requires(T const &a, T const &b)
{
{ a != b } -> std::convertible_to<bool>;
}
Allows to detect whether a type defines operator!= at compile time.
Definition Metaprogramming.h:62

Detailed Description

Allows to detect whether a type defines operator!= at compile time.

Example:

if constexpr (Utils::is_operator_not_eq_defined<MyType>) {
// implementation allows to write a != b (with a/b of MyType)
} else {
// no such operator... alternate implementation
}