3 Forward declares `boost::hana::permutations`.
5 @copyright Louis Dionne 2013-2016
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)
10 #ifndef BOOST_HANA_FWD_PERMUTATIONS_HPP
11 #define BOOST_HANA_FWD_PERMUTATIONS_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Return a sequence of all the permutations of the given sequence.
19 //! @ingroup group-Sequence
21 //! Specifically, `permutations(xs)` is a sequence whose elements are
22 //! permutations of the original sequence `xs`. The permutations are not
23 //! guaranteed to be in any specific order. Also note that the number
24 //! of permutations grows very rapidly as the length of the original
25 //! sequence increases. The growth rate is `O(length(xs)!)`; with a
26 //! sequence `xs` of length only 8, `permutations(xs)` contains over
32 //! @include example/permutations.cpp
33 #ifdef BOOST_HANA_DOXYGEN_INVOKED
34 constexpr auto permutations = [](auto&& xs) {
35 return tag-dispatched;
38 template <typename S, typename = void>
39 struct permutations_impl : permutations_impl<S, when<true>> { };
41 struct permutations_t {
42 template <typename Xs>
43 constexpr auto operator()(Xs&& xs) const;
46 constexpr permutations_t permutations{};
48 BOOST_HANA_NAMESPACE_END
50 #endif // !BOOST_HANA_FWD_PERMUTATIONS_HPP