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 (unary operator+)

template<typename TLhs>
concept UnaryMinusable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that a TLhs supports the unary minus operator (unary operator-)

template<typename TLhs>
concept Addressable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that a TLhs is addressable (i.e., it supports unary operator&)

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 unary operator*)

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 unary operator->)

template<typename TLhs, typename TRhs = TLhs>
concept Addable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are addable (they support binary operator+)

template<typename TLhs, typename TRhs = TLhs>
concept Subtractable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are subtractable (they support binary operator-)

template<typename TLhs, typename TRhs = TLhs>
concept Multipliable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are multipliable (they support binary operator*)

template<typename TLhs, typename TRhs = TLhs>
concept Dividible#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are dividible (they support binary operator/)

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 and TRhs are binary andable (they support binary operator&)

template<typename TLhs, typename TRhs = TLhs>
concept BinaryOrable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are binary orable (they support binary operator|)

template<typename TLhs>
concept BooleanNotable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that a TLhs supports the boolean not operator (operator!)

template<typename TLhs, typename TRhs = TLhs>
concept BooleanAndable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are boolean andable (they support binary operator&&)

template<typename TLhs, typename TRhs = TLhs>
concept BooleanOrable#
#include <hyperion/mpl/concepts/operator_able.h>

Concept definition requiring that TLhs and TRhs are boolean orable (they support binary operator||)