Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:03

0001 /*!
0002 @file
0003 Forward declares `boost::hana::basic_tuple`.
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_BASIC_TUPLE_HPP
0011 #define BOOST_HANA_FWD_BASIC_TUPLE_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/fwd/core/make.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! @ingroup group-datatypes
0019     //! Stripped down version of `hana::tuple`.
0020     //!
0021     //! Whereas `hana::tuple` aims to provide an interface somewhat close to a
0022     //! `std::tuple`, `basic_tuple` provides the strict minimum required to
0023     //! implement a closure with maximum compile-time efficiency.
0024     //!
0025     //! @note
0026     //! When you use a container, remember not to make assumptions about its
0027     //! representation, unless the documentation gives you those guarantees.
0028     //! More details [in the tutorial](@ref tutorial-containers-types).
0029     //!
0030     //!
0031     //! Modeled concepts
0032     //! ----------------
0033     //! `Sequence`, and all the concepts it refines
0034     template <typename ...Xs>
0035     struct basic_tuple;
0036 
0037     //! Tag representing `hana::basic_tuple`.
0038     //! @relates hana::basic_tuple
0039     struct basic_tuple_tag { };
0040 
0041 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0042     //! Function object for creating a `basic_tuple`.
0043     //! @relates hana::basic_tuple
0044     //!
0045     //! Given zero or more objects `xs...`, `make<basic_tuple_tag>` returns a
0046     //! new `basic_tuple` containing those objects. The elements are held by
0047     //! value inside the resulting tuple, and they are hence copied or moved
0048     //! in. This is analogous to `std::make_tuple` for creating `basic_tuple`s.
0049     //!
0050     //!
0051     //! Example
0052     //! -------
0053     //! @include example/basic_tuple/make.cpp
0054     template <>
0055     constexpr auto make<basic_tuple_tag> = [](auto&& ...xs) {
0056         return basic_tuple<std::decay_t<decltype(xs)>...>{forwarded(xs)...};
0057     };
0058 #endif
0059 
0060     //! Alias to `make<basic_tuple_tag>`; provided for convenience.
0061     //! @relates hana::basic_tuple
0062     //!
0063     //!
0064     //! Example
0065     //! -------
0066     //! @include example/basic_tuple/make.cpp
0067     BOOST_HANA_INLINE_VARIABLE constexpr auto make_basic_tuple = make<basic_tuple_tag>;
0068 }} // end namespace boost::hana
0069 
0070 #endif // !BOOST_HANA_FWD_BASIC_TUPLE_HPP