]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*! |
2 | @file | |
3 | Forward declares `boost::hana::fold`. | |
4 | ||
b32b8144 | 5 | @copyright Louis Dionne 2013-2017 |
7c673cae FG |
6 | Distributed under the Boost Software License, Version 1.0. |
7 | (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | |
8 | */ | |
9 | ||
10 | #ifndef BOOST_HANA_FWD_FOLD_HPP | |
11 | #define BOOST_HANA_FWD_FOLD_HPP | |
12 | ||
13 | #include <boost/hana/config.hpp> | |
14 | #include <boost/hana/fwd/fold_left.hpp> | |
15 | ||
16 | ||
1e59de90 | 17 | namespace boost { namespace hana { |
7c673cae FG |
18 | //! Equivalent to `fold_left`; provided for convenience. |
19 | //! @ingroup group-Foldable | |
20 | //! | |
21 | //! `fold` is equivalent to `fold_left`. However, it is not tag-dispatched | |
22 | //! on its own because it is just an alias to `fold_left`. Also note that | |
23 | //! `fold` can be called with or without an initial state, just like | |
24 | //! `fold_left`: | |
25 | //! | |
26 | //! @code | |
27 | //! fold(xs, state, f) == fold_left(xs, state, f) | |
28 | //! fold(xs, f) == fold_left(xs, f) | |
29 | //! @endcode | |
30 | //! | |
31 | //! | |
32 | //! Example | |
33 | //! ------- | |
34 | //! @include example/fold.cpp | |
1e59de90 TL |
35 | BOOST_HANA_INLINE_VARIABLE constexpr auto fold = fold_left; |
36 | }} // end namespace boost::hana | |
7c673cae FG |
37 | |
38 | #endif // !BOOST_HANA_FWD_FOLD_HPP |