Boost logo

Boost :

Subject: Re: [boost] Move notes
From: David Abrahams (dave_at_[hidden])
Date: 2009-09-07 17:50:50

on Mon Sep 07 2009, Ion Gaztañaga <> wrote:

> David Abrahams escribió:
>> Hi Ion,
>> A few things I noticed looking through move.hpp in the sandbox
>> 1. you static_cast in one direction but reinterpret_cast in the other.
>> Why?
> A bug was reported for SunPro with static_cast producing an infinite loop:

I don't think that's a good enough reason to have them be different.
Yeah, we're over the line in forming these invalid references but at
least I'd like to be able to point to the pointer round-tripping rules
and say we got that part right. In this case we might even be better
off with C-style casts.

>> 3. I think its operator[] can be wrong for some iterators. See
> Ok, I'm quite lost to find a proper solution, what do you suggest?

You could always use iterator_adaptor to build this puppy :-) It solves
this problem as well as possible. Otherwise, just return value_type
instead of reference.

Dave Abrahams
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at