Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-23 14:11:35


Pavol Droba <droba_at_[hidden]> writes:

>> I'm not sure a fix is needed. The first variant will already match
>> const containers, as long as they're not temporaries.
>>
>>
>> template <class T>
>> int f(T& x);
>>
>> int const x;
>> int y = f(x); // T deduced as const int.
>>
>
> You are right, there is no restriction on const, rather ther is a restriction,
> that the input must be valid R-value i.e. not a temporary.

Temporaries *are* rvalues; I think you must mean lvalue.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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