On Sun, Apr 8, 2012 at 5:22 PM, Anton Yemelyanov
<anton.ye...@gmail.com> wrote:
Simply replace a signature argument with decltype(fn) and build.. if this works on gcc (i am confirming that at least plain functions work on vc 2010), then this will be good to go.
Have you been able to reduce the call to 2 arguments, or did you do:
Function...< ..., decltype(::puts), ::puts >
?
i'm looking to create a template like:
typedef FunctionTo11< InCa, ::puts > Callback;
but i cannot figure out how to syntactically declare the FunctionTo11 template. (11 == C++11)
You will then need to replace each use of signature with decltype(fn) and remove extra template argument.
But i have an ordering problem:
FunctionTo< Tag, Signature, FunctionPtr >
in order to get Signature i have to decltype(FunctionPtr). So far i have not been able to formulate that properly (==compile errors).
Or.. create an intermediate template function that doesn't take a signature but then invokes the original template function with decltype(fn) as a signature..
How do i declare the intermediary to be able to take any function pointer? The only way i know of to do that is to generate specializations for each arity.
"awesome" wouldn't event begin to describe that...
Let's get it working, then :). i'm stuck on the syntax and i'm not finding much about decltype in the context of template parameters. Mostly stackoverflow questions (some of them interesting, but haven't solved this problem so far).