Function pointer != function object.
D'oh; I misread what you'd said.
Posted 03 May 2012 - 05:44 PM
If it's any consolation, MSVC 2010 apparently doesn't supply the function pointer conversion, so I need to amend my statement to include verbiage along the lines of "with standard conforming compilers...".
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX
Posted 04 May 2012 - 01:07 AM
I'm probably going to get bashed - again - for stating my thoughts but... why not to just autobox them to an appropriate std::function at this point?The type of a lambda function is a unique anonymous functor type for every lambda function. Two separate lambdas that have the exact same definition in the exact same scope will have two separate types. As such, trying to get at the exact type of a lambda function is an exercise in futility. Just store the std::function by value.
Posted 04 May 2012 - 01:12 AM
In C++, what you don't use, you don't pay for. If you are not using std::function, and since it can't anyways as that's not in the language spec, you don't have to pay for std::function. Furthermore, if it DID do something silly like that (and it is quite silly) it would require an implicit inclusion of the <functional> header.I'm probably going to get bashed - again - for stating my thoughts but... why not to just autobox them to an appropriate std::function at this point?
The type of a lambda function is a unique anonymous functor type for every lambda function. Two separate lambdas that have the exact same definition in the exact same scope will have two separate types. As such, trying to get at the exact type of a lambda function is an exercise in futility. Just store the std::function by value.
I mean, really, I feel that a bit rough. It's just me.
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX
Posted 04 May 2012 - 07:03 AM