1#ifndef CLASSDESC_FUNCTIONDB0
2#define CLASSDESC_FUNCTIONDB0
3template <
class F,
template<
class>
class P>
6 static const bool value=true ;
14 static const int value=0;
24template <
class C,
class R>
25struct Arity<R (* C::*)()>
28 static const int value=0;
31template <
class C,
class R>
32struct Return<R (* C::*)()>
38template <
class C,
class R>
39struct Arity<R (C::*)()>
42 static const int value=0;
45template <
class C,
class R>
46struct Return<R (C::*)()>
52template <
class C,
class R>
53struct Arity<R (C::*)() const>
56 static const int value=0;
59template <
class C,
class R>
60struct Return<R (C::*)() const>
66template <
class C,
class R>
67struct ClassOf<R (C::*)()>
73template <
class C,
class R>
74struct ClassOf<R (*C::*)()>
80template <
class C,
class R>
81struct ClassOf<R (C::*)() const>
87template <
class C,
class R>
88struct is_member_function_ptr<R (C::*)()>
90 static const bool value=
true;
93template <
class C,
class R>
94struct is_member_function_ptr<R (C::*)() const>
96 static const bool value=
true;
99template <
class C,
class R>
100struct is_const_method<R (C::*)() const>
102 static const bool value=
true;
106struct is_nonmember_function_ptr<R (*)()>
108 static const bool value=
true;
111template <
class C,
class R>
112struct is_nonmember_function_ptr<R (*C::*)()>
114 static const bool value=
true;
117template <
class C,
class D,
class R>
118class bound_method<C, R (D::*)()>
124 static const int arity=0;
126 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
127 bound_method(C& obj, M method): obj(&obj), method(method) {}
128 typename enable_if<Not<classdesc::is_const<C> >, R>::T
129 operator()()
const {
return (obj->*method)();}
130 void rebind(C& newObj) {obj=&newObj;}
131 static const bool is_const=
false;
134template <
class C,
class D,
class R>
135class bound_method<const C, R (D::*)()>
141 static const int arity=0;
143 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
144 bound_method(
const C& obj, M method): obj(&obj), method(method) {}
145 R operator()()
const {
146 throw std::runtime_error(
"cannot call method, inappropriate argument type");
148 void rebind(C& newObj) {obj=&newObj;}
149 static const bool is_const=
false;
152template <
class C,
class D,
class R>
153class bound_method<C, R (D::*)() const>
155 typedef R (D::*M)()
const;
159 static const int arity=0;
161 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
162 bound_method(C& obj, M method): obj(obj), method(method) {}
163 R operator()()
const {
return (obj.*method)();}
164 static const bool is_const=
true;
167#if defined(__cplusplus) && __cplusplus>=201703L
171struct Arity<R (*)() noexcept>
173 static const int V=0;
174 static const int value=0;
178struct Return<R (*)() noexcept>
184template <
class C,
class R>
185struct Arity<R (* C::*)() noexcept>
187 static const int V=0;
188 static const int value=0;
191template <
class C,
class R>
192struct Return<R (* C::*)() noexcept>
198template <
class C,
class R>
199struct Arity<R (C::*)() noexcept>
201 static const int V=0;
202 static const int value=0;
205template <
class C,
class R>
206struct Return<R (C::*)() noexcept>
212template <
class C,
class R>
213struct Arity<R (C::*)() const noexcept>
215 static const int V=0;
216 static const int value=0;
219template <
class C,
class R>
220struct Return<R (C::*)() const noexcept>
226template <
class C,
class R>
227struct ClassOf<R (C::*)() noexcept>
233template <
class C,
class R>
234struct ClassOf<R (*C::*)()
noexcept>
240template <
class C,
class R>
241struct ClassOf<R (C::*)() const noexcept>
247template <
class C,
class R>
248struct is_member_function_ptr<R (C::*)() noexcept>
250 static const bool value=
true;
253template <
class C,
class R>
254struct is_member_function_ptr<R (C::*)() const noexcept>
256 static const bool value=
true;
259template <
class C,
class R>
260struct is_const_method<R (C::*)() const noexcept>
262 static const bool value=
true;
266struct is_nonmember_function_ptr<R (*)()
noexcept>
268 static const bool value=
true;
271template <
class C,
class R>
272struct is_nonmember_function_ptr<R (*C::*)()
noexcept>
274 static const bool value=
true;
277template <
class C,
class D,
class R>
278class bound_method<C, R (D::*)() noexcept>
284 static const int arity=0;
286 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
287 bound_method(C& obj, M method): obj(&obj), method(method) {}
288 typename enable_if<Not<classdesc::is_const<C> >, R>::T
289 operator()()
const {
return (obj->*method)();}
290 void rebind(C& newObj) {obj=&newObj;}
291 static const bool is_const=
false;
294template <
class C,
class D>
295class bound_method<C, void (D::*)() noexcept>
297 typedef void (D::*M)();
301 static const int arity=0;
303 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
304 bound_method(C& obj, M method): obj(&obj), method(method) {}
305 typename enable_if<Not<classdesc::is_const<C> > >::T
306 operator()()
const {(obj->*method)();}
307 void rebind(C& newObj) {obj=&newObj;}
308 static const bool is_const=
false;
311template <
class C,
class D,
class R>
312class bound_method<const C, R (D::*)() noexcept>
318 static const int arity=0;
320 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
321 bound_method(
const C& obj, M method): obj(&obj), method(method) {}
322 R operator()()
const {
323 throw std::runtime_error(
"cannot call method, inappropriate argument type");
325 void rebind(C& newObj) {obj=&newObj;}
326 static const bool is_const=
false;
329template <
class C,
class D>
330class bound_method<const C, void (D::*)() noexcept>
332 typedef void (D::*M)();
336 static const int arity=0;
338 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
339 bound_method(
const C& obj, M method): obj(&obj), method(method) {}
340 typename enable_if<Not<classdesc::is_const<C> > >::T
342 throw std::runtime_error(
"cannot call method, inappropriate argument type");
344 void rebind(C& newObj) {obj=&newObj;}
345 static const bool is_const=
false;
348template <
class C,
class D,
class R>
349class bound_method<C, R (D::*)() const noexcept>
351 typedef R (D::*M)()
const;
355 static const int arity=0;
357 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
358 bound_method(C& obj, M method): obj(obj), method(method) {}
359 R operator()()
const {
return (obj.*method)();}
360 static const bool is_const=
true;
363template <
class C,
class D>
364class bound_method<C, void (D::*)() const noexcept>
366 typedef void (D::*M)()
const;
370 static const int arity=0;
372 template <
int i>
struct Arg:
public functional::Arg<M,i> {};
373 bound_method(C& obj, M method): obj(obj), method(method) {}
374 void operator()()
const {(obj.*method)();}
375 static const bool is_const=
true;
379template <
class F,
class Args>
380typename enable_if<And<AllArgs<F, is_rvalue>, Eq<Arity<F>::value, 0> >,
381 typename Return<F>::T>::T
382apply_nonvoid_fn(F f, Args& a, Fdummy<F> dum=0)
393template <
class F,
class Args>
394typename enable_if<And<AllArgs<F, is_rvalue>, Eq<Arity<F>::value, 0> >,
396apply_void_fn(F f, Args& a, Fdummy<F> dum=0)
401template <
class Buffer,
class F>
402typename enable_if<Eq<Arity<F>::value, 0>,
typename Return<F>::T>::T
403callOnBuffer(Buffer& buffer, F f)
Definition functiondb0.h:161
Definition functiondb0.h:126
Definition functiondb0.h:143