Random thoughts:
Perhaps you can get the type of the proxy object using decltype(*func()) or, in addition, to access the proxy object. There are no modifiers for auto , except for the usual const , & etc.
If this is a lazy estimate, you probably don't want the final type of object right now, do you?
If the proxy server has a cenversion statement for the destination object, how does auto know that it should be used? What if there are more?
source share