|
||||
File indexing completed on 2024-11-15 09:13:42
0001 /*! 0002 @file 0003 Forward declares `boost::hana::accessors`. 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_ACCESSORS_HPP 0011 #define BOOST_HANA_FWD_ACCESSORS_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 #include <boost/hana/core/when.hpp> 0015 0016 0017 namespace boost { namespace hana { 0018 //! Returns a `Sequence` of pairs representing the accessors of the 0019 //! data structure. 0020 //! @ingroup group-Struct 0021 //! 0022 //! Given a `Struct` `S`, `accessors<S>()` is a `Sequence` of `Product`s 0023 //! where the first element of each pair is the "name" of a member of 0024 //! the `Struct`, and the second element of each pair is a function that 0025 //! can be used to access that member when given an object of the proper 0026 //! data type. As described in the global documentation for `Struct`, the 0027 //! accessor functions in this sequence must be move-independent. 0028 //! 0029 //! 0030 //! Example 0031 //! ------- 0032 //! @include example/accessors.cpp 0033 #ifdef BOOST_HANA_DOXYGEN_INVOKED 0034 template <typename S> 0035 constexpr auto accessors = []() { 0036 return tag-dispatched; 0037 }; 0038 #else 0039 template <typename S, typename = void> 0040 struct accessors_impl : accessors_impl<S, when<true>> { }; 0041 0042 template <typename S> 0043 struct accessors_t; 0044 0045 template <typename S> 0046 BOOST_HANA_INLINE_VARIABLE constexpr accessors_t<S> accessors{}; 0047 #endif 0048 }} // end namespace boost::hana 0049 0050 #endif // !BOOST_HANA_FWD_ACCESSORS_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |