Skip to content

Feature/conceptcheck

Carsten Gräser requested to merge feature/conceptcheck into master

This introduces the function

template<class C, class... T>
static constexpr bool models();

Its result indicates if the concept C is modelled by the collection T... of types. A concept is a list of expressions that a type must support. Concepts can refine other concepts to inherit all requirements from those base concepts. Besides the concept check function itself, this contains some helper functions of the form require* that transform a non-matching condition to a substitution failure. E.g.,

requireConvertible<R>(t.f())

is not valid unless the result of t.f() is convertible to R.

Since models() is the user interface, it's contained in the namespace Dune::. In contrast the various require*() functions needed for concept definitions are in the namespace Dune::Concept::. I strongly propose that concept definitions themselves also go into namespaces Dune::(NonCoreModule::)Concept.

This merge request depends on the TypeList feature (!7 (merged)).

Merge request reports