
18 May
2008
18 May
'08
4:28 a.m.
On Friday 16 May 2008 22:01, Ronald Garcia wrote:
Something like the following:
template< typename F > inline F& unwrap(F& f) { return f; }
template< typename F > inline F& unwrap(reference_wrapper<F>& f) { return f; }
template< typename F > inline F& unwrap(reference_wrapper<F> const& f) { return f; }
Couldn't you do a little better (half the number of overloads) by using boost::unwrap_reference for the return type? For example, template<typename F> boost::unwrap_reference<F>::type& unwrap(F &f) { return f; } -- Frank