|
| 1 | +/*============================================================================= |
| 2 | + Copyright (c) 2022 Denis Mikhailov |
| 3 | + Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | +==============================================================================*/ |
| 6 | + |
| 7 | +#if !defined(BOOST_FUSION_ADAPTED_STRUCT_ADAPT_PFR_HPP) |
| 8 | +#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_PFR_HPP |
| 9 | + |
| 10 | +#include <boost/fusion/support/config.hpp> |
| 11 | +#include <boost/fusion/adapted/pfr/detail/at_impl.hpp> |
| 12 | +#include <boost/fusion/adapted/pfr/detail/begin_impl.hpp> |
| 13 | +#include <boost/fusion/adapted/pfr/detail/category_of_impl.hpp> |
| 14 | +#include <boost/fusion/adapted/pfr/detail/end_impl.hpp> |
| 15 | +#include <boost/fusion/adapted/pfr/detail/is_sequence_impl.hpp> |
| 16 | +#include <boost/fusion/adapted/pfr/detail/is_view_impl.hpp> |
| 17 | +#include <boost/fusion/adapted/pfr/detail/size_impl.hpp> |
| 18 | +#include <boost/fusion/adapted/pfr/detail/value_at_impl.hpp> |
| 19 | +#include <boost/fusion/support/tag_of_fwd.hpp> |
| 20 | + |
| 21 | +#define BOOST_FUSION_ADAPT_PFR(NAME) \ |
| 22 | + \ |
| 23 | + namespace boost { namespace fusion { \ |
| 24 | + struct pfr_tag; \ |
| 25 | + struct fusion_sequence_tag; \ |
| 26 | + \ |
| 27 | + namespace traits \ |
| 28 | + { \ |
| 29 | + template<> \ |
| 30 | + struct tag_of<NAME> \ |
| 31 | + { \ |
| 32 | + using type = pfr_tag; \ |
| 33 | + }; \ |
| 34 | + template<> \ |
| 35 | + struct tag_of<NAME const> \ |
| 36 | + { \ |
| 37 | + using type = pfr_tag; \ |
| 38 | + }; \ |
| 39 | + } \ |
| 40 | + }} \ |
| 41 | + \ |
| 42 | + namespace boost { namespace mpl \ |
| 43 | + { \ |
| 44 | + template<typename> \ |
| 45 | + struct sequence_tag; \ |
| 46 | + \ |
| 47 | + template<> \ |
| 48 | + struct sequence_tag<NAME> \ |
| 49 | + { \ |
| 50 | + using type = fusion::fusion_sequence_tag; \ |
| 51 | + }; \ |
| 52 | + \ |
| 53 | + template<> \ |
| 54 | + struct sequence_tag<NAME const> \ |
| 55 | + { \ |
| 56 | + using type = fusion::fusion_sequence_tag; \ |
| 57 | + }; \ |
| 58 | + }} |
| 59 | + |
| 60 | +#define BOOST_FUSION_ADAPT_TPL_PFR(NAME) \ |
| 61 | + \ |
| 62 | + namespace boost { namespace fusion { \ |
| 63 | + struct pfr_tag; \ |
| 64 | + struct fusion_sequence_tag; \ |
| 65 | + \ |
| 66 | + namespace traits \ |
| 67 | + { \ |
| 68 | + template<typename... Args> \ |
| 69 | + struct tag_of<NAME<Args...>> \ |
| 70 | + { \ |
| 71 | + using type = pfr_tag; \ |
| 72 | + }; \ |
| 73 | + template<typename... Args> \ |
| 74 | + struct tag_of<NAME<Args...> const> \ |
| 75 | + { \ |
| 76 | + using type = pfr_tag; \ |
| 77 | + }; \ |
| 78 | + } \ |
| 79 | + }} \ |
| 80 | + \ |
| 81 | + namespace boost { namespace mpl \ |
| 82 | + { \ |
| 83 | + template<typename> \ |
| 84 | + struct sequence_tag; \ |
| 85 | + \ |
| 86 | + template<typename... Args> \ |
| 87 | + struct sequence_tag<NAME<Args...>> \ |
| 88 | + { \ |
| 89 | + using type = fusion::fusion_sequence_tag; \ |
| 90 | + }; \ |
| 91 | + \ |
| 92 | + template<typename... Args> \ |
| 93 | + struct sequence_tag<NAME<Args...> const> \ |
| 94 | + { \ |
| 95 | + using type = fusion::fusion_sequence_tag; \ |
| 96 | + }; \ |
| 97 | + }} |
| 98 | + |
| 99 | +#endif |
0 commit comments