
on Wed Mar 14 2012, Gordon Woodhull <gordon-AT-woodhull.com> wrote:
If the type of o did not involve poly, then you could pass a reference to o to another translation unit where the definition of poly was not visible. In that other translation unit you could call it with an arbitrary type, which would have to instantiate poly::operator() without sight of its definition. Therefore, I conclude that this is clearly impossible.
I had neglected the fact that overloaded_function does type erasure (duh). I guess this would only be possible if the polymorphic result_of (or equivalent) is passed to overloaded_function. Probably not worth it.
I think Lorenzo's assessment ("not possible") is more accurate. -- Dave Abrahams BoostPro Computing http://www.boostpro.com