MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
foldable.hpp
Go to the documentation of this file.
1 
12 #ifndef BOOST_MPL11_FWD_FOLDABLE_HPP
13 #define BOOST_MPL11_FWD_FOLDABLE_HPP
14 
16 #include <boost/mpl11/fwd/bool.hpp>
22 #include <boost/mpl11/fwd/ring.hpp>
23 
24 
25 namespace boost { namespace mpl11 {
46  template <typename Datatype, typename = true_>
47  struct Foldable;
48 
62  template <typename f, typename state, typename structure>
63  struct foldr;
64 
69  template <typename f, typename structure>
70  struct foldr1;
71 
89  template <typename f, typename state, typename structure>
90  struct foldl;
91 
96  template <typename f, typename structure>
97  struct foldl1;
98 
99 
104  template <typename predicate, typename structure>
105  BOOST_MPL11_DOXYGEN_ALIAS(all, foldr<
106  compose<lift<and_>, predicate>,
107  true_,
108  structure
109  >);
110 
112  template <typename structure>
114 
119  template <typename predicate, typename structure>
121  all<compose<lift<not_>, predicate>, structure>);
122 
124  template <typename structure>
126 
130  template <typename predicate, typename structure>
132 
134  template <typename structure>
136 
138  template <typename structure>
141 
143  template <typename structure>
146 
151  template <typename predicate, typename structure>
153  foldr1<bind<lift<if_>, predicate, arg<2>, arg<1>>, structure>);
154 
156  template <typename structure>
158 
163  template <typename predicate, typename structure>
165  foldr1<bind<lift<if_>, predicate, arg<1>, arg<2>>, structure>);
166 
168  template <typename structure>
170 
178  template <typename f, typename structure>
180  apply<foldl<lift<partial>, f, structure>>);
182 }} // end namespace boost::mpl11
183 
184 #endif // !BOOST_MPL11_FWD_FOLDABLE_HPP
Compute the sum of the elements of a structure.
Definition: foldable.hpp:140
Forward declares the Functional module.
Returns the least element of a non-empty structure.
Definition: foldable.hpp:169
Lifts a metafunction.
Definition: functional.hpp:155
Returns the largest element of a non-empty structure.
Definition: foldable.hpp:157
Forward declares the Integer datatype.
Invokes f with the result of invoking each fs... with the arguments.
Definition: functional.hpp:266
Forwards to boost/mpl11/fwd/integer.hpp.
Manages configurable options of the library and defines utility macros.
Forward declares logical metafunctions.
Additive identity for the given Datatype.
Definition: monoid.hpp:63
Invokes a metafunction class with the contents of a structure.
Definition: foldable.hpp:180
Forward declares the Monoid typeclass.
Equivalent to all, structure>.
Definition: foldable.hpp:113
Returns the nth of its arguments.
Definition: functional.hpp:294
Equivalent to none, structure>.
Definition: foldable.hpp:125
Right-associative fold of a structure using a binary operation.
Definition: foldable.hpp:56
Returns the composition of several metafunction classes.
Definition: functional.hpp:213
Equivalent to any, structure>.
Definition: foldable.hpp:135
Returns whether any element of the structure satisfies the predicate.
Definition: foldable.hpp:131
The largest element of a non-empty structure with respect to the given predicate. ...
Definition: foldable.hpp:153
Multiplicative identity for the given Datatype.
Definition: ring.hpp:63
The least element of a non-empty structure with respect to the given predicate.
Definition: foldable.hpp:165
#define BOOST_MPL11_DOXYGEN_ALIAS(NAME,...)
Macro expanding to a struct when generating the documentation and to an alias otherwise.
Definition: config.hpp:56
Invokes a metafunction class with the given arguments.
Definition: functional.hpp:39
Compute the product of the elements of a structure.
Definition: foldable.hpp:145
Returns whether all the elements of the structure satisfy the predicate.
Definition: foldable.hpp:109
Returns the logical negation (!) of its argument.
Definition: logical.hpp:55
Left-associative fold of a structure using a binary operation.
Definition: foldable.hpp:62
Forward declares the Orderable typeclass.
Variant of foldr that has no base case, and thus may only be applied to non-empty structures...
Definition: foldable.hpp:79
Returns whether none of the elements of the structure satisfy the predicate.
Definition: foldable.hpp:121
Forward declares the Ring typeclass.