1/*!
2@file
3Forward declares `boost::hana::permutations`.
4
5Copyright Louis Dionne 2013-2022
6Distributed 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_PERMUTATIONS_HPP
11#define BOOST_HANA_FWD_PERMUTATIONS_HPP
12
13#include <boost/hana/config.hpp>
14#include <boost/hana/core/when.hpp>
15
16
17namespace boost { namespace hana {
18 //! Return a sequence of all the permutations of the given sequence.
19 //! @ingroup group-Sequence
20 //!
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
27 //! 40 000 elements!
28 //!
29 //!
30 //! Example
31 //! -------
32 //! @include example/permutations.cpp
33#ifdef BOOST_HANA_DOXYGEN_INVOKED
34 constexpr auto permutations = [](auto&& xs) {
35 return tag-dispatched;
36 };
37#else
38 template <typename S, typename = void>
39 struct permutations_impl : permutations_impl<S, when<true>> { };
40
41 struct permutations_t {
42 template <typename Xs>
43 constexpr auto operator()(Xs&& xs) const;
44 };
45
46 BOOST_HANA_INLINE_VARIABLE constexpr permutations_t permutations{};
47#endif
48}} // end namespace boost::hana
49
50#endif // !BOOST_HANA_FWD_PERMUTATIONS_HPP
51

source code of boost/libs/hana/include/boost/hana/fwd/permutations.hpp