|
|
|||
File indexing completed on 2025-12-15 09:53:03
0001 /*! 0002 @file 0003 Forward declares `boost::hana::cartesian_product`. 0004 0005 Copyright Louis Dionne 2013-2022 0006 Distributed under the Boost Software License, Version 1.0. 0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 0008 */ 0009 0010 #ifndef BOOST_HANA_FWD_CARTESIAN_PRODUCT_HPP 0011 #define BOOST_HANA_FWD_CARTESIAN_PRODUCT_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 #include <boost/hana/core/when.hpp> 0015 0016 0017 namespace boost { namespace hana { 0018 //! Computes the cartesian product of a sequence of sequences. 0019 //! @ingroup group-Sequence 0020 //! 0021 //! Given a sequence of sequences, `cartesian_product` returns a new 0022 //! sequence of sequences containing the cartesian product of the 0023 //! original sequences. For this method to finish, a finite number 0024 //! of finite sequences must be provided. 0025 //! 0026 //! @note 0027 //! All the sequences must have the same tag, and that tag must also match 0028 //! that of the top-level sequence. 0029 //! 0030 //! 0031 //! Signature 0032 //! --------- 0033 //! Given a `Sequence` `S(T)`, the signature is 0034 //! \f[ 0035 //! \mathtt{cartesian\_product} : S(S(T)) \to S(S(T)) 0036 //! \f] 0037 //! 0038 //! @param xs 0039 //! A sequence of sequences of which the cartesian product is computed. 0040 //! 0041 //! 0042 //! Example 0043 //! ------- 0044 //! @include example/cartesian_product.cpp 0045 #ifdef BOOST_HANA_DOXYGEN_INVOKED 0046 constexpr auto cartesian_product = [](auto&& xs) { 0047 return tag-dispatched; 0048 }; 0049 #else 0050 template <typename S, typename = void> 0051 struct cartesian_product_impl : cartesian_product_impl<S, when<true>> { }; 0052 0053 struct cartesian_product_t { 0054 template <typename Xs> 0055 constexpr auto operator()(Xs&& xs) const; 0056 }; 0057 0058 BOOST_HANA_INLINE_VARIABLE constexpr cartesian_product_t cartesian_product{}; 0059 #endif 0060 }} // end namespace boost::hana 0061 0062 #endif // !BOOST_HANA_FWD_CARTESIAN_PRODUCT_HPP
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|