This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, so_7]: Allowing __move on const references


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?

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]