
On May 21, 2007, at 4:20 PM, Tobias Schwinger wrote:
Douglas Gregor wrote:
As soon as decltype gets in the language, result_of just "does the right thing" without this (or any) kludges. The LWG has accepted the appropriate change in principle, but of course it can't go in until decltype goes in.
Well, that last paragraph reads confusing to me.
What is decltype(an_int()) or decltype(non_callable()), then? No compile error?!
An error.
And isn't result_of working around a problem elsewhere in the language (namely the non-lazy instantiation of the nullary call operator), in fact making the switch to a decltype-based implementation harder?
As Peter noted, we'll also be using variadic templates, e.g., template<typename T> struct reference_wrapper { T* ptr; template<typename... Args> typename result_of<T(Args&&...)>::type operator()(Args&&... args); }; - Doug