Boost logo

Boost :

Subject: Re: [boost] [type trait extension] I hate volatile...
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2011-07-16 17:22:48


> I think you're mis-diagnosing this error.  Experiments suggest that when
> RET=int the cv-qualifiers are ignored on the function return type, so
> rc, rv, and rcv are all defining functions identical to r.  When RET=ret
> the qualifiers are not ignored.
>
> I can't find anything in the C++0x standard (N3290) to suggest that this
> should happen.

Just found the explanation in C++98 standard (3.10 Lvalues and rvalues):
"Class rvalues can have cv-qualified types; non-class rvalues always
have cv-unqualified types."
This confirms what you wrote: cv qualifiers are ignored in non-class
return types (int...).

Of course, this does not help me a lot...

Frédéric


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