X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fmpl.hh;h=761ebf45ebe6850ffa2a04cac0f7e07573b6d52e;hb=394a298567543441521439ad15f7016cd569c449;hp=5eee0c5f9b1308f9b25da9931455eadbfa7bb7be;hpb=f5ca463966327288e825764fbee26b92f07cbd6a;p=senf.git diff --git a/Utils/mpl.hh b/Utils/mpl.hh index 5eee0c5..761ebf4 100644 --- a/Utils/mpl.hh +++ b/Utils/mpl.hh @@ -27,6 +27,7 @@ #define HH_mpl_ 1 // Custom includes +#include "../config.hh" //#include "mpl.mpp" #include "mpl.ih" @@ -38,9 +39,14 @@ namespace mpl { /** \defgroup senfmpl Low-level template meta programming helpers */ -# ifndef SENF_MPL_RV_ALIGNMENT -# define SENF_MPL_RV_ALIGNMENT 16 -# endif + /** \brief Marker class for empty default values etc. + + This is like Boosts \c boost::mpl::na just an empty class used as template default argument + to mark missing arguments + + \note Don't use this as an empty base class. We may add some informative members to this. + */ + struct nil {}; /** \brief Return-value type used to implement overload selection @@ -185,6 +191,17 @@ namespace mpl { static senf::mpl::rv<0> _SENF_MPL_SLOT_ ## name (_); \ SENF_MPL_SLOT_SET(name,value) + /** \brief Define MPL slot initialized to 0 + + This is like \ref SENF_MPL_SLOT_DEF() but initializes the slot to the fixed value 0. The + advantage over \ref SENF_MPL_SLOT_DEF() is, that this macro may be called from an include + file whereas all the other \\c SENF_MPL_SLOT_ macros must always be called from the relevant + file. + */ +# define SENF_MPL_SLOT_DEF_ZERO(name) \ + template \ + static senf::mpl::rv<0> _SENF_MPL_SLOT_ ## name (_); + /** \brief Set MPL slot \see \ref SENF_MPL_SLOT_DEF() \ingroup senfmpl