Boost logo

Boost :

From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2008-05-17 15:12:26


On Sat, May 17, 2008 at 4:01 AM, Ronald Garcia <garcia_at_[hidden]> wrote:
>
> On May 16, 2008, at 6:33 PM, Peter Dimov wrote:
>
>> Ronald Garcia:
>>> Hi all,
>>>
>>> boost::reference_wrapper exists at the top-level of boost (in boost/
>>> ref.hpp), but that header provides no way to unwrap a
>>> reference_wrapper. There are two implementations floating around of
>>> "unwrap", one in boost.bind's implementation details, and one in
>>> boost.mpl's implementation details. Is there any problem with
>>> providing a version of unwrap in ref.hpp?
>>
>> What is the specification of unwrap that you have in mind?
>
> 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;
> }
>
>

What about the corresponding metafunctions that compute the result value?

-- 
gpd

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