6#include <bond/core/config.h>
13template <
typename Tuple, u
int16_t Id,
typename T>
16 typedef Tuple struct_type;
17 typedef typename std::remove_reference<T>::type value_type;
18 typedef typename remove_maybe<value_type>::type field_type;
19 typedef reflection::optional_field_modifier field_modifier;
21 static const Metadata metadata;
22 BOND_STATIC_CONSTEXPR uint16_t
id = Id;
24 static BOND_CONSTEXPR
const value_type& GetVariable(
const struct_type& obj)
26 return std::get<id>(obj);
29 static BOND_CONSTEXPR value_type& GetVariable(struct_type& obj)
31 return std::get<id>(obj);
34 static Metadata GetMetadata()
37 m.name =
"item" + std::to_string(
id);
42using ignore_t =
decltype(std::ignore);
44template <
typename Tuple, u
int16_t t_
id,
typename T>
45const Metadata tuple_field<Tuple, t_id, T>::metadata
46 = tuple_field<Tuple, t_id, T>::GetMetadata();
49template <
typename Tuple, uint16_t id,
typename ...Rest>
struct
52template <
typename Tuple, uint16_t id,
typename T,
typename ...Rest>
struct
53tuple_fields<Tuple, id, T, Rest...>
55 typedef typename boost::mpl::push_front<
56 typename tuple_fields<Tuple,
id + 1, Rest...>::type,
57 tuple_field<Tuple, id, T>
61template <
typename Tuple, uint16_t id,
typename ...Rest>
struct
62tuple_fields<Tuple, id,
const ignore_t&, Rest...>
63 : tuple_fields<Tuple,
id + 1, Rest...>
66template <
typename Tuple, u
int16_t
id>
struct
67tuple_fields<Tuple, id>
69 typedef typename boost::mpl::list<>::type type;
73template <
typename ...T>
struct
76template <
typename T,
typename ...Rest>
struct
79 typedef typename boost::mpl::push_front<
80 typename param_list<Rest...>::type,
81 typename std::add_pointer<T>::type
85template <
typename ...Rest>
struct
86param_list<
const ignore_t&, Rest...>
93 typedef boost::mpl::list<> type;
namespace bond
Definition: apply.h:17