models< ConceptSig, Enable > Struct Template Reference

Returns whether a concept signature ConceptSig is satisfied. More...

#include <atria/meta/concept.hpp>

Detailed Description

template<typename ConceptSig, typename Enable = void>
struct atria::meta::models< ConceptSig, Enable >

Returns whether a concept signature ConceptSig is satisfied.

A concept signature has the form ConceptSpec(T0, T1, ...) where ConceptSpec is a concept specification type, and the types T0... are the types that we want to test against ConceptSpec.

A concept specification type is a type that contains a template constexpr method requires_(T0&&, T1&&...) that is available iff types T0, T1... satisfy the concept. This method is never going to be used in an evaluated context, and its return type is irrelevant. This enables usign a decltype(...) expression that validates the concept in the return type specification. For example:

struct Equality_comparable_spec
{
template <typename T>
auto requires_(T&& x) -> decltype(
bool(x != x),
bool(x == x)));
template <typename T, typename U>
auto requires_(T&& x, U&& y) -> decltype(
bool(x != y),
bool(x == y)));
};

Definition at line 152 of file concept.hpp.


The documentation for this struct was generated from the following file:
Fork me on GitHub