
on Mon Sep 07 2009, Ion Gaztañaga <igaztanaga-AT-gmail.com> 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 http://www.boost.org/doc/libs/1_40_0/libs/iterator/doc/iterator_facade.html#...
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 http://www.boostpro.com