64 template <
typename U = type>
65 auto get_sfinae(
const U& obj,
int,
int,
void*&
ptr,
size_t nhash)
66 ->
decltype((void) obj.get(
ptr,
nhash), void())
72 template <
typename U = type,
typename base_type =
typename U::base_type>
73 auto get_sfinae(
const U& obj,
int,
long,
void*&
ptr,
size_t nhash)
74 ->
decltype((void)
static_cast<const base_type&
>(obj).get(
ptr,
nhash), void())
80 template <
typename U = type>
81 void get_sfinae(
const U&,
long,
long,
void*&,
size_t)
109 template <
typename Dp,
typename... Args>
112 static_assert(std::is_same<Dp, data_type>::value,
"Error! Dp != type::get()");
113 sfinae(obj, 0, 0, dst, std::forward<Args>(args)...);
119 sfinae(_obj, 0, 0, _data);
127 template <
typename Up,
typename Dp,
typename... Args,
129 auto sfinae(
const Up& obj,
int,
int, Dp& dst, Args&&... args)
130 ->
decltype((void) obj.get(std::forward<Args>(args)...), void())
132 dst = obj.get(std::forward<Args>(args)...);
138 template <
typename Up,
typename Dp,
typename... Args,
140 auto sfinae(
const Up& obj,
int,
long, Dp& dst, Args&&...)
141 ->
decltype((void) obj.get(), void())
149 template <
typename Up,
typename Dp,
typename... Args,
150 enable_if_t<has_data<Up>::value,
char> = 0>
151 void sfinae(
const Up&,
long,
long, Dp&, Args&&...)
157 template <
typename Up,
typename Dp,
typename... Args,
158 enable_if_t<!has_data<Up>::value,
char> = 0>
159 void sfinae(
const Up&,
long,
long, Dp&, Args&&...)
174template <
typename Tp>
178 using data_type = std::tuple<std::string, decltype(std::declval<type>().get())>;
187 template <
typename Dp,
typename... Args>
190 static_assert(std::is_same<Dp, data_type>::value,
191 "Error! Dp != tuple<string, type::get()>");
192 sfinae(obj, 0, 0, dst, std::forward<Args>(args)...);
198 sfinae(_obj, 0, 0, _data);
206 template <
typename Up,
typename Dp,
typename... Args,
208 auto sfinae(
const Up& obj,
int,
int, Dp& dst, Args&&... args)
209 ->
decltype((void) obj.get(std::forward<Args>(args)...), void())
211 dst =
data_type(type::get_label(), obj.get(std::forward<Args>(args)...));
217 template <
typename Up,
typename Dp,
typename... Args,
219 auto sfinae(
const Up& obj,
int,
long, Dp& dst, Args&&...)
220 ->
decltype((void) obj.get(), void())
222 dst =
data_type(type::get_label(), obj.get());
228 template <
typename Up,
typename Dp,
typename... Args,
229 enable_if_t<has_data<Up>::value,
char> = 0>
230 void sfinae(
const Up&,
long,
long, Dp&, Args&&...)
236 template <
typename Up,
typename Dp,
typename... Args,
237 enable_if_t<!has_data<Up>::value,
char> = 0>
238 void sfinae(
const Up&,
long,
long, Dp&, Args&&...)
typename std::enable_if< B, T >::type enable_if_t
Alias template for enable_if.
auto get(const auto_bundle< Tag, Types... > &_obj)
The declaration for the types for operations without definitions.
Include the macros for operations.
Declare the operations types.
The purpose of this operation class is to combine the output types from the "get()" member function f...
decltype(std::declval< type >().get()) data_type
data_type operator()(const type &_obj)
get_data(const type &obj, Dp &dst, Args &&... args)
std::tuple< std::string, decltype(std::declval< type >().get())> data_type
data_type operator()(const type &_obj)
get_labeled_data(const type &obj, Dp &dst, Args &&... args)
The purpose of this operation class is to provide a non-template hook to get the object itself.
TIMEMORY_DELETED_OBJECT(get) get(const type &obj