X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fmpl.hh;h=5428e1dff73f037613d33c1ed5534c09e1914d8c;hb=28275a1a9075ae42dc29aaadc5bc78e6fa204e26;hp=ba600835869550878313fec6a1093ddd664a286e;hpb=271789888cd1ae6361607616f9f4e6e460e192c4;p=senf.git
diff --git a/Utils/mpl.hh b/Utils/mpl.hh
index ba60083..5428e1d 100644
--- a/Utils/mpl.hh
+++ b/Utils/mpl.hh
@@ -36,9 +36,18 @@
namespace senf {
namespace mpl {
- /** \defgroup senfmpl Low-level template meta programming helpers
+ /** \defgroup senfmpl Template meta programming helpers
*/
+ /** \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
The senf::mpl::rv type is used together with \ref SENF_MPL_RV() to select template
@@ -96,8 +105,8 @@ namespace mpl {
never called.
This number is than forwarded as template argument to \c select which is specialized for
- each case. Therefore, choice has a \c frobble() member whereas
- choice has a \c dazzle() member.
+ each case. Therefore, choice\ has a \c frobble() member whereas
+ choice\ has a \c dazzle() member.
\see \ref SENF_MPL_RV
\ingroup senfmpl
@@ -182,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