density
C++11 library for paged memory management, function queues, heterogeneous queues and lifo memory management
|
A type F
is a TypeFeature if:
F
satisfies LiteralTypeF::make<T>()
is valid as constant expression that returns an instance of F
bound to the target type T
A type feature is a class that captures and exposes a specific property or action of a target type, without depending from it at compile time. Most times features store a pointer to a function (that is like an entry in a vtable), but they may hold just data (like f_size and f_alignment do).
Usually a TypeFeature has this form:
The static function template make creates an instance of the feature bound to a type. The function call operator invokes the feature.
The following snippet shows the synopsis of f_size, f_default_construct and f_equal.