Operatorability Concepts#
- group operatorability_concepts
Assortment of
concept
definitions requiring type(s) to support various operators.Example:#
#include <hyperion/mpl/concepts/comparable.h using namespace hyperion::mpl::concepts; struct not_addable {}; static_assert(Addable<int, double>); static_assert(!Addable<not_addable, int>);
-
template<typename TLhs>
concept UnaryPlusable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
supports the unary plus operator (unaryoperator+
)
-
template<typename TLhs>
concept UnaryMinusable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
supports the unary minus operator (unaryoperator-
)
-
template<typename TLhs>
concept Addressable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
is addressable (i.e., it supports unaryoperator&
)Note
This be
true
for types. It is rarely (read: never) not an error to overload the address-of operator
-
template<typename TLhs>
concept Dereferencible# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
is dereferencible (i.e., it supports unaryoperator*
)
-
template<typename TLhs>
concept Arrowable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
supports the pointer-to-memeber operator (i.e., it supports unaryoperator->
)
-
template<typename TLhs, typename TRhs = TLhs>
concept Addable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that
TLhs
andTRhs
are addable (they support binaryoperator+
)
-
template<typename TLhs, typename TRhs = TLhs>
concept Subtractable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that
TLhs
andTRhs
are subtractable (they support binaryoperator-
)
-
template<typename TLhs, typename TRhs = TLhs>
concept Multipliable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that
TLhs
andTRhs
are multipliable (they support binaryoperator*
)
-
template<typename TLhs, typename TRhs = TLhs>
concept Dividible# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that
TLhs
andTRhs
are dividible (they support binaryoperator/
)
-
template<typename TLhs>
concept BinaryNotable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
supports the binary not operator (operator~
)
-
template<typename TLhs, typename TRhs = TLhs>
concept BinaryAndable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that
TLhs
andTRhs
are binary andable (they support binaryoperator&
)
-
template<typename TLhs, typename TRhs = TLhs>
concept BinaryOrable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that
TLhs
andTRhs
are binary orable (they support binaryoperator|
)
-
template<typename TLhs>
concept BooleanNotable# - #include <hyperion/mpl/concepts/operator_able.h>
Concept definition requiring that a
TLhs
supports the boolean not operator (operator!
)