+ 1

C++ Meta programming

How does one pass member pointer to a variadic function so as to use perfect forwarding?

16th Sep 2018, 10:44 PM
Meekness
Meekness - avatar
3 Réponses
+ 4
I've never used member pointers or perfect forwarding so I can't make any promises. But, based on my reading of those topics, I don't expect it to be any different than a regular pointer. Perfect fowarding should handle them the same.
16th Sep 2018, 11:48 PM
John Wells
John Wells - avatar
+ 3
I'm not a master C++ programmer and will always think in C. I also am unfamiliar with "meta programming" and "perfect forwarding" so forgive my answer if it's not to your satisfaction... Firstly, why does it matter that the function is variadic? You treat it as a normal function argument. Secondly, what use case would you have to pass a single member to a function and not the entire object (well a ref at any rate). The approach is flawed IMHO. While you should be able to use a pointer to a pointer, I don't see the point. What're you trying to achieve? Some code would help. Or a link to what you're trying to do.
16th Sep 2018, 11:08 PM
non
0
please how can i convert a number to a string Bison this post is off topic and therefore spam. Please delete it. Easiest way is: http://www.cplusplus.com/reference/cstdio/sprintf/
16th Sep 2018, 11:59 PM
Bison