1#ifndef CLASSDESC_FUNCTIONDB1
2#define CLASSDESC_FUNCTIONDB1
3template <
class R,
class A1>
4struct Arg<R (*)(A1), 1>
10template <
class C,
class R,
class A1>
11struct Arg<R (C::*)(A1), 1>
17template <
class C,
class R,
class A1>
18struct Arg<R (C::*)(A1) const, 1>
24#if defined(__cplusplus) && __cplusplus>=201703L
26template <
class R,
class A1>
27struct Arg<R (*)(A1)
noexcept, 1>
33template <
class C,
class R,
class A1>
34struct Arg<R (C::*)(A1) noexcept, 1>
40template <
class C,
class R,
class A1>
41struct Arg<R (C::*)(A1) const noexcept, 1>
47template <
class F,
template<
class>
class P>
50 static const bool value=
true && P<typename Arg<F,1>::T>::value;
54template <
class R,
class A1>
55struct Arity<R (*)(A1)>
58 static const int value=1;
61template <
class R,
class A1>
62struct Return<R (*)(A1)>
68template <
class C,
class R,
class A1>
69struct Arity<R (* C::*)(A1)>
72 static const int value=1;
75template <
class C,
class R,
class A1>
76struct Return<R (* C::*)(A1)>
82template <
class C,
class R,
class A1>
83struct Arity<R (C::*)(A1)>
86 static const int value=1;
89template <
class C,
class R,
class A1>
90struct Return<R (C::*)(A1)>
96template <
class C,
class R,
class A1>
97struct Arity<R (C::*)(A1) const>
100 static const int value=1;
103template <
class C,
class R,
class A1>
104struct Return<R (C::*)(A1) const>
110template <
class C,
class R,
class A1>
111struct ClassOf<R (C::*)(A1)>
117template <
class C,
class R,
class A1>
118struct ClassOf<R (*C::*)(A1)>
124template <
class C,
class R,
class A1>
125struct ClassOf<R (C::*)(A1) const>
131template <
class C,
class R,
class A1>
132struct is_member_function_ptr<R (C::*)(A1)>
134 static const bool value=
true;
137template <
class C,
class R,
class A1>
138struct is_member_function_ptr<R (C::*)(A1) const>
140 static const bool value=
true;
143template <
class C,
class R,
class A1>
144struct is_const_method<R (C::*)(A1) const>
146 static const bool value=
true;
149template <
class R,
class A1>
150struct is_nonmember_function_ptr<R (*)(A1)>
152 static const bool value=
true;
155template <
class C,
class R,
class A1>
156struct is_nonmember_function_ptr<R (*C::*)(A1)>
158 static const bool value=
true;
161template <
class C,
class D,
class R,
class A1>
162class bound_method<C, R (D::*)(A1)>
164 typedef R (D::*M)(A1);
168 static const int arity=1;
170 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
171 bound_method(C& obj, M method): obj(&obj), method(method) {}
172 typename enable_if<Not<classdesc::is_const<C> >, R>::T
173 operator()(A1 a1)
const {
return (obj->*method)(a1);}
174 void rebind(C& newObj) {obj=&newObj;}
175 static const bool is_const=
false;
178template <
class C,
class D,
class R,
class A1>
179class bound_method<const C, R (D::*)(A1)>
181 typedef R (D::*M)(A1);
185 static const int arity=1;
187 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
188 bound_method(
const C& obj, M method): obj(&obj), method(method) {}
189 R operator()(A1 a1)
const {
190 throw std::runtime_error(
"cannot call method, inappropriate argument type");
192 void rebind(C& newObj) {obj=&newObj;}
193 static const bool is_const=
false;
196template <
class C,
class D,
class R,
class A1>
197class bound_method<C, R (D::*)(A1) const>
199 typedef R (D::*M)(A1)
const;
203 static const int arity=1;
205 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
206 bound_method(C& obj, M method): obj(obj), method(method) {}
207 R operator()(A1 a1)
const {
return (obj.*method)(a1);}
208 static const bool is_const=
true;
211#if defined(__cplusplus) && __cplusplus>=201703L
214template <
class R,
class A1>
215struct Arity<R (*)(A1)
noexcept>
217 static const int V=1;
218 static const int value=1;
221template <
class R,
class A1>
222struct Return<R (*)(A1)
noexcept>
228template <
class C,
class R,
class A1>
229struct Arity<R (* C::*)(A1)
noexcept>
231 static const int V=1;
232 static const int value=1;
235template <
class C,
class R,
class A1>
236struct Return<R (* C::*)(A1)
noexcept>
242template <
class C,
class R,
class A1>
243struct Arity<R (C::*)(A1) noexcept>
245 static const int V=1;
246 static const int value=1;
249template <
class C,
class R,
class A1>
250struct Return<R (C::*)(A1) noexcept>
256template <
class C,
class R,
class A1>
257struct Arity<R (C::*)(A1) const noexcept>
259 static const int V=1;
260 static const int value=1;
263template <
class C,
class R,
class A1>
264struct Return<R (C::*)(A1) const noexcept>
270template <
class C,
class R,
class A1>
271struct ClassOf<R (C::*)(A1) noexcept>
277template <
class C,
class R,
class A1>
278struct ClassOf<R (*C::*)(A1)
noexcept>
284template <
class C,
class R,
class A1>
285struct ClassOf<R (C::*)(A1) const noexcept>
291template <
class C,
class R,
class A1>
292struct is_member_function_ptr<R (C::*)(A1) noexcept>
294 static const bool value=
true;
297template <
class C,
class R,
class A1>
298struct is_member_function_ptr<R (C::*)(A1) const noexcept>
300 static const bool value=
true;
303template <
class C,
class R,
class A1>
304struct is_const_method<R (C::*)(A1) const noexcept>
306 static const bool value=
true;
309template <
class R,
class A1>
310struct is_nonmember_function_ptr<R (*)(A1)
noexcept>
312 static const bool value=
true;
315template <
class C,
class R,
class A1>
316struct is_nonmember_function_ptr<R (*C::*)(A1)
noexcept>
318 static const bool value=
true;
321template <
class C,
class D,
class R,
class A1>
322class bound_method<C, R (D::*)(A1) noexcept>
324 typedef R (D::*M)(A1);
328 static const int arity=1;
330 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
331 bound_method(C& obj, M method): obj(&obj), method(method) {}
332 typename enable_if<Not<classdesc::is_const<C> >, R>::T
333 operator()(A1 a1)
const {
return (obj->*method)(a1);}
334 void rebind(C& newObj) {obj=&newObj;}
335 static const bool is_const=
false;
338template <
class C,
class D,
class A1>
339class bound_method<C, void (D::*)(A1) noexcept>
341 typedef void (D::*M)(A1);
345 static const int arity=1;
347 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
348 bound_method(C& obj, M method): obj(&obj), method(method) {}
349 typename enable_if<Not<classdesc::is_const<C> > >::T
350 operator()(A1 a1)
const {(obj->*method)(a1);}
351 void rebind(C& newObj) {obj=&newObj;}
352 static const bool is_const=
false;
355template <
class C,
class D,
class R,
class A1>
356class bound_method<const C, R (D::*)(A1) noexcept>
358 typedef R (D::*M)(A1);
362 static const int arity=1;
364 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
365 bound_method(
const C& obj, M method): obj(&obj), method(method) {}
366 R operator()(A1 a1)
const {
367 throw std::runtime_error(
"cannot call method, inappropriate argument type");
369 void rebind(C& newObj) {obj=&newObj;}
370 static const bool is_const=
false;
373template <
class C,
class D,
class A1>
374class bound_method<const C, void (D::*)(A1) noexcept>
376 typedef void (D::*M)(A1);
380 static const int arity=1;
382 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
383 bound_method(
const C& obj, M method): obj(&obj), method(method) {}
384 typename enable_if<Not<classdesc::is_const<C> > >::T
385 operator()(A1 a1)
const {
386 throw std::runtime_error(
"cannot call method, inappropriate argument type");
388 void rebind(C& newObj) {obj=&newObj;}
389 static const bool is_const=
false;
392template <
class C,
class D,
class R,
class A1>
393class bound_method<C, R (D::*)(A1) const noexcept>
395 typedef R (D::*M)(A1)
const;
399 static const int arity=1;
401 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
402 bound_method(C& obj, M method): obj(obj), method(method) {}
403 R operator()(A1 a1)
const {
return (obj.*method)(a1);}
404 static const bool is_const=
true;
407template <
class C,
class D,
class A1>
408class bound_method<C, void (D::*)(A1) const noexcept>
410 typedef void (D::*M)(A1)
const;
414 static const int arity=1;
416 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
417 bound_method(C& obj, M method): obj(obj), method(method) {}
418 void operator()(A1 a1)
const {(obj.*method)(a1);}
419 static const bool is_const=
true;
423template <
class F,
class Args>
424typename enable_if<And<AllArgs<F, is_rvalue>, Eq<Arity<F>::value, 1> >,
425 typename Return<F>::T>::T
426apply_nonvoid_fn(F f, Args& a, Fdummy<F> dum=0)
437template <
class F,
class Args>
438typename enable_if<And<AllArgs<F, is_rvalue>, Eq<Arity<F>::value, 1> >,
440apply_void_fn(F f, Args& a, Fdummy<F> dum=0)
445template <
class Buffer,
class F>
446typename enable_if<Eq<Arity<F>::value, 1>,
typename Return<F>::T>::T
447callOnBuffer(Buffer& buffer, F f)
449 typename remove_const<typename remove_reference<typename Arg<F,1>::T>::type>::type a1;
Definition functiondb1.h:205
Definition functiondb1.h:170
Definition functiondb1.h:187