c++ - Expand macro at where it's defined, rather than where it's called -
Looks stupid, is it possible?
struct bar {void dummy () {} # defined act (name, ...) dummy (); \ // Do something inside the bar, not in the main). Et (push_back, 42);
I do not think so, but I'm trying to define a variation macro in some way as a member function of bar
. Regular version looks like this:
template & lt; Typename Func, typename ... Args & gt; Auto Act (FUN Funk, ARG & amp; Eg) - & gt; Decltype (func (std :: forward & lt; azae & gt; (args) ...) {Freak (CTD :: Forward & lt; ARJE & gt; (RGS) ...); } Two types of things are required for:
: I want to use this macro to define each member's work required:
#define cmf (name) struct name \ {\ template & lt; Typename ... Args & gt; \ Auto Operator () (RGS & ... args) - & gt; Decltype (cont.name (std :: forward & lt; azae & gt; (args) ...)) {\ return cont.name (std :: forward & lt; ergos & gt; (ARG) ...) ; \} \} Name; // ... bar.push_back (42);
or an insufficient artist:
bar.act (std :: bind ((zero (std :: vector & lt; int & gt; : *) (Stat typname std :: vector & lt; int & gt; :: value_type & value)) & std :: vector & lt; int & gt; :: push_back, and bar.cont, std :: placeholder: : _ 1), 42);
My goal is to use this polymer macro to call the cmf
for name logic, and then for the function arguments __VA_ARGS __ .
Comments
Post a Comment