MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
minimal_iterable.hpp
Go to the documentation of this file.
1 
6 #ifndef BOOST_MPL11_TEST_MINIMAL_ITERABLE_HPP
7 #define BOOST_MPL11_TEST_MINIMAL_ITERABLE_HPP
8 
9 #include <boost/mpl11/bool.hpp>
10 #include <boost/mpl11/core.hpp>
11 #include <boost/mpl11/iterable.hpp>
12 
13 
14 struct MinimalIterable;
15 
25 template <typename ...xs>
27  using type = minimal_iterable;
28  using mpl_datatype = MinimalIterable;
29 };
30 
31 namespace boost { namespace mpl11 {
32  template <>
33  struct Iterable<MinimalIterable>
34  : instantiate<Iterable>::with<MinimalIterable>
35  {
36  template <typename>
37  struct head_impl;
38 
39  template <typename x, typename ...xs>
40  struct head_impl<minimal_iterable<x, xs...>> : x { };
41 
42 
43  template <typename>
44  struct tail_impl;
45 
46  template <typename x, typename ...xs>
47  struct tail_impl<minimal_iterable<x, xs...>>
48  : minimal_iterable<xs...>
49  { };
50 
51 
52  template <typename>
53  struct is_empty_impl;
54 
55  template <typename ...xs>
56  struct is_empty_impl<minimal_iterable<xs...>>
57  : bool_<sizeof...(xs) == 0>
58  { };
59  };
60 }} // end namespace boost::mpl11
61 
62 #endif // !BOOST_MPL11_TEST_MINIMAL_ITERABLE_HPP
Defines the Iterable typeclass.
Minimal iterable for testing purposes.
Definition: minimal_iterable.hpp:26
Defines the Core module.
Forwards to boost/mpl11/integer.hpp.