2013/5/2 Kazutoshi Satoda
On 2013/04/09 16:24 +0900, Nathan Crookston wrote:
std::reference_wrapper includes an overload of operator()[1] which allows a wrapped function object to be called without needing to first unwrap: (snip) I think it would be valuable to update boost::ref to match the standard version.
Is it OK to require the template argument to be a complete type?
The standard version requires complete type for operator() support, which results in sticking on the boost version for some cases.
https://groups.google.com/a/isocpp.org/d/msg/std-discussion/_tavlfXkOrc/wIxT...
I think it's better to have two; std::reference_wrapper which has operator() but requires complete types, and boost::reference_wrapper which allows incomplete types but doesn't have operator(), and users can choose between them for their purpose.
Isn't it possible to provide operator() and allow T to be incomplete as long as operator() isn't used? Regards, Kris