MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
monoid.hpp
Go to the documentation of this file.
1 
12 #ifndef BOOST_MPL11_MONOID_HPP
13 #define BOOST_MPL11_MONOID_HPP
14 
16 
17 #include <boost/mpl11/bool.hpp>
18 #include <boost/mpl11/core.hpp>
20 
21 
22 namespace boost { namespace mpl11 {
23  template <typename Left, typename Right, typename>
24  struct Monoid : false_ { };
25 
26  template <typename x1, typename x2, typename ...xn>
27  struct plus
28  : detail::left_folds::variadic<plus, x1, x2, xn...>
29  { };
30 
31  template <typename x, typename y>
32  struct plus<x, y> :
33  Monoid<
34  typename datatype<typename x::type>::type,
35  typename datatype<typename y::type>::type
36  >::template plus_impl<typename x::type, typename y::type>
37  { };
38 
39  template <typename Datatype>
40  struct zero : Monoid<Datatype>::template zero_impl<> { };
41 }} // end namespace boost::mpl11
42 
43 #endif // !BOOST_MPL11_MONOID_HPP
Forward declares the Monoid typeclass.
Defines the Core module.
Defines boost::mpl11::detail::left_folds::variadic.
Forwards to boost/mpl11/integer.hpp.