Den 04-10-2017 kl. 15:32 skrev Chris Glover via Boost:
I think you have a way to turn these into pointers again in Boost.Container, By defining some preprocessor symbol, right? Having pointers matters when interfacing with other types, because this is the only case where the iterators are seen as contiguous.
I would much rather see that in debug mode the iterator type is a class and in release mode it is a pointer compared to having extra preprocessor symbols.
This is a bad idea. Early std library implementations did this and it caused several problems, including code that compiled in release, but not debug, or worse, different overload resolution between debug and release builds.
Sure, the whole point of having a class type in debug mode is to catch things at compile time. And don't you get the same when we start defining BOOST_CONTAINER_ITERATOR_AS_POINTER? -T