3 Forward declares `boost::hana::cartesian_product`.
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_CARTESIAN_PRODUCT_HPP
11 #define BOOST_HANA_FWD_CARTESIAN_PRODUCT_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Computes the cartesian product of a sequence of sequences.
19 //! @ingroup group-Sequence
21 //! Given a sequence of sequences, `cartesian_product` returns a new
22 //! sequence of sequences containing the cartesian product of the
23 //! original sequences. For this method to finish, a finite number
24 //! of finite sequences must be provided.
27 //! All the sequences must have the same tag, and that tag must also match
28 //! that of the top-level sequence.
33 //! Given a `Sequence` `S(T)`, the signature is
35 //! \mathtt{cartesian\_product} : S(S(T)) \to S(S(T))
39 //! A sequence of sequences of which the cartesian product is computed.
44 //! @include example/cartesian_product.cpp
45 #ifdef BOOST_HANA_DOXYGEN_INVOKED
46 constexpr auto cartesian_product = [](auto&& xs) {
47 return tag-dispatched;
50 template <typename S, typename = void>
51 struct cartesian_product_impl : cartesian_product_impl<S, when<true>> { };
53 struct cartesian_product_t {
54 template <typename Xs>
55 constexpr auto operator()(Xs&& xs) const;
58 constexpr cartesian_product_t cartesian_product{};
60 BOOST_HANA_NAMESPACE_END
62 #endif // !BOOST_HANA_FWD_CARTESIAN_PRODUCT_HPP