Concept types

To most concepts defined in GLAS, we attach a unique identifier (a type). For the concept A, this is glas::A_concept in the glas/concept/ directory.

Computing the concept type of an expression

The meta function concept<X>::type computes the list of concepts that the type X is a model of. This meta function is specialized for all models in GLAS. This must be a Boost::MPL::ForwardSequence, where each element satisfies the Concept concept.

For example,

boost::mpl::vector<vector_collection_concept, view_concept>
is the list of concepts for sparse_dense_view. Here,
struct vector_collection_concept {
  typedef boost::mpl::vector<vector_expression_concept> depends_on ;
} ;
indicates that VectorCollection is a specialization of VectorExpression.

Users who which to create their own classes, should specialize the concept meta-function for their classes.

Checking whether a type is a model of A

The meta function
is_A<X>
allows us to check whether the type X is a model of the concept A. This is a Boolean IntegralConstant. The function does not verify an exact match of the list of concepts in concept<X>::type, but also the depends_on fields of each element of the list. Hence is_vector_expression<sparse_dense_view<...> > is true since a VectorCollection is a specialization of VectorExpression.