Boost logo

Boost :

From: Ronald Garcia (garcia_at_[hidden])
Date: 2008-05-27 15:31:03


Since I haven't heard any more conversation about this, would it be
alright to add Frank's implementation below to ref.hpp? Is anything
more needed?

ron

On May 17, 2008, at 9:28 PM, Frank Mori Hess wrote:

> 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
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/
> listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk