3 Forward declares `boost::hana::accessors`.
5 @copyright Louis Dionne 2013-2017
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_ACCESSORS_HPP
11 #define BOOST_HANA_FWD_ACCESSORS_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Returns a `Sequence` of pairs representing the accessors of the
20 //! @ingroup group-Struct
22 //! Given a `Struct` `S`, `accessors<S>()` is a `Sequence` of `Product`s
23 //! where the first element of each pair is the "name" of a member of
24 //! the `Struct`, and the second element of each pair is a function that
25 //! can be used to access that member when given an object of the proper
26 //! data type. As described in the global documentation for `Struct`, the
27 //! accessor functions in this sequence must be move-independent.
32 //! @include example/accessors.cpp
33 #ifdef BOOST_HANA_DOXYGEN_INVOKED
35 constexpr auto accessors = []() {
36 return tag-dispatched;
39 template <typename S, typename = void>
40 struct accessors_impl : accessors_impl<S, when<true>> { };
46 constexpr accessors_t<S> accessors{};
48 BOOST_HANA_NAMESPACE_END
50 #endif // !BOOST_HANA_FWD_ACCESSORS_HPP