John Maddock wrote:
Trying to get back to the case in point... is there any reason not to support both in the binary library?
ie
virtual int operator()( boost::function
const& F ) = 0; virtual int operator()( std::function const& F ) = 0;
If you make the function virtual that just makes the problem worse. A
non-virtual function will fail to link if you pass boost::function from one
side but take std::function from the other. A virtual will silently call the
std::function-taking override, passing it a boost::function. Much joy
results.
All this really makes no sense at all; boost::function should be used.
But, if you really wanted to know, libstdc++ in a situation like the above
(when the function has to be virtual because it's f.ex. specified that way
by the standard) does something like the following:
#if cpp11
virtual int __f( boost::function