MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
group.hpp
Go to the documentation of this file.
1 
12 #ifndef BOOST_MPL11_GROUP_HPP
13 #define BOOST_MPL11_GROUP_HPP
14 
16 
17 #include <boost/mpl11/fwd/bool.hpp>
18 #include <boost/mpl11/fwd/core.hpp>
20 
21 
22 namespace boost { namespace mpl11 {
23  template <>
24  struct instantiate<Group> {
25  template <typename Left, typename Right = Left>
26  struct with;
27 
28  template <typename Datatype>
29  struct with<Datatype> : true_ {
30  template <typename x, typename y>
31  using minus_impl = plus<box<x>, negate<box<y>>>;
32 
33  template <typename x>
34  using negate_impl = minus<zero<Datatype>, box<x>>;
35  };
36  };
37 }} // end namespace boost::mpl11
38 
39 
40 #include <boost/mpl11/bool.hpp>
41 #include <boost/mpl11/core.hpp>
42 
43 
44 namespace boost { namespace mpl11 {
45  template <typename Left, typename Right, typename>
46  struct Group : false_ { };
47 
48  template <typename x, typename y>
49  struct minus :
50  Group<
51  typename datatype<typename x::type>::type,
52  typename datatype<typename y::type>::type
53  >::template minus_impl<typename x::type, typename y::type>
54  { };
55 
56  template <typename x>
57  struct negate :
58  Group<typename datatype<typename x::type>::type>::
59  template negate_impl<typename x::type>
60  { };
61 }} // end namespace boost::mpl11
62 
63 #endif // !BOOST_MPL11_GROUP_HPP
Forward declares the Core module.
Forward declares the Group typeclass.
Forwards to boost/mpl11/fwd/integer.hpp.
Forward declares the Monoid typeclass.
Defines the Core module.
Forwards to boost/mpl11/integer.hpp.