Dune Core Modules (2.8.0)
Concepts built on top of C++14. More...
Namespaces | |
namespace | Dune::Concept |
Namespace for concepts. | |
Classes | |
struct | Dune::Concept::Refines< BaseConcepts > |
Base class for refined concepts. More... | |
Functions | |
template<class C , class... T> | |
constexpr auto | Dune::models () |
Check if concept is modeled by given types. More... | |
Detailed Description
Concepts built on top of C++14.
Function Documentation
◆ models()
|
constexpr |
Check if concept is modeled by given types.
This will check if the given concept is modeled by the given list of types. This is true if the list of types models all the base concepts that are refined by the given concept and if it satisfies all additional requirements of the latter.
Notice that a concept may be defined for a list of interacting types. The function will check if the given list of types matches the requirements on the whole list. It does not check if each individual type in the list satisfies the concept.
This concept check mechanism is inspired by the concept checking facility in Eric Nieblers range-v3. For more information please refer to the libraries project page https://github.com/ericniebler/range-v3 or this blog entry: http://ericniebler.com/2013/11/23/concept-checking-in-c11. In fact the interface provided here is almost exactly the same as in range-v3. However the implementation differs, because range-v3 uses its own meta-programming library whereas our implementation is more straight forward.
The result is returned as std::integral_constant<bool, ...> which allows to nicely use this method with Hybrid::ifElse.
- Template Parameters
-
C The concept to check T The list of type to check against the concept
References Dune::models().
Referenced by Dune::Functions::Concept::isCallable(), and Dune::models().