/** * @file include/ActivMiddleware/Misc/MetaFunctions.h * * @brief Header for miscellaneous meta functions. */ #if (!defined ACTIV_MISC_META_FUNCTIONS_H) #define ACTIV_MISC_META_FUNCTIONS_H #include "ActivMiddleware/ActivMiddleware.h" //! Activ namespace. namespace Activ { //! Simple wrapper for a type. template class Identity { public: typedef T type; }; // --------------------------------------------------------------------------------------------------------------------------------- /** * @brief Make an Identity for a type. * * The intention for this is to prettify Boost::mpl::for_each usage: * * Boost::mpl::for_each >(someFunctor); * * someFunctor would have an operator() such as: * * template * void operator()(Identity) { } * * This avoids any default construction cost of the types in SomeTypeList, or the use of Boost::add_pointer or similar * (which can look confusing). */ template class MakeIdentity { public: typedef Identity type; }; } // namespace Activ #endif // (!defined ACTIV_MISC_META_FUNCTIONS_H)