documenting copyright correctly
[senf.git] / Utils / mpl.hh
index 5eee0c5..bb9115e 100644 (file)
@@ -27,6 +27,7 @@
 #define HH_mpl_ 1
 
 // Custom includes
+#include "../config.hh"
 
 //#include "mpl.mpp"
 #include "mpl.ih"
@@ -38,10 +39,6 @@ namespace mpl {
     /** \defgroup senfmpl Low-level template meta programming helpers
      */
 
-#   ifndef SENF_MPL_RV_ALIGNMENT
-#       define SENF_MPL_RV_ALIGNMENT 16
-#   endif
-
     /** \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
@@ -185,6 +182,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 <class _>                                                                        \
+        static senf::mpl::rv<0> _SENF_MPL_SLOT_ ## name (_);
+
     /** \brief Set MPL slot
         \see \ref SENF_MPL_SLOT_DEF()
         \ingroup senfmpl