This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch, so_7]: Allowing __move on const references
- From: chris jefferson <caj at cs dot york dot ac dot uk>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 11 Sep 2005 01:34:06 +0100
- Subject: Re: [patch, so_7]: Allowing __move on const references
- References: <4323026C.4030306@cs.york.ac.uk> <432324B8.4070900@suse.de>
Paolo Carlini wrote:
>Hi Chris,
>
>
>
>>+ // We shouldn't need this overload of __move. It is needed in particular
>>+ // for forward (and better) iterators which don't return a non-const
>>+ // reference to the value they represent. The standard says there shouldn't
>>+ // be any such iterators. Then someone wrote vector<bool>, which breaks that
>>+ // rule.
>>
>>
>>
>First, thanks for the patch, I will commit it soon.
>
>In a nitpicking mood, maybe the comment could be improved: in my
>understanding the real problem is with iterators having operator*()
>returning by *value* not by const& (const& is a legal return type,
>24.1/4). In fact, the latter return type, thanks to the "templatization"
>of __move are already "digested" and processed correctly by your
>infrastructure: only, downstream, correcty (otherwise we would move
>const objects!), __is_moveable is false.
>
>Do you agree that saying simply "by value" instead of "non-const
>reference" is clearer?
>
>
Yes, and more accurate :)
Chris