instances: Use traits to proxy information about compile-time selected features.
The Trait helper class is introduced in definitions.h, it defines boolean attributes which respects to compile-time options (such as O_COMPRESSION). The instance of this class specifiing what is compiled-in can be obtained by calling Traits::compiled(). Traits can be then used to specify when will instance be generated, atomic traits are given by pointer-to-member of Traits structure which specifies if feature is enabled (or by pointer-to-member-function-returning-bool). Those atomic traits are wrapped in Traits::Get object, to became traits. Traits can be combined using logincal operations !, && and || (see for example traits for Mpi topology).
parent
44ec1dc1
Please register or sign in to comment