Typedef for iterators denoting positions to insert/erase

Paolo Carlini paolo.carlini@oracle.com
Sat Aug 30 15:43:00 GMT 2014


Hi,

On 08/29/2014 04:16 PM, Jonathan Wakely wrote:
> Is this worth doing in the other containers too?
If the idea works for std::string, why not?
> I'm undecided whether it's clearer to read the preprocessor condition
> or a declaration with the non-standard __pos_iterator type, but I
> think I'd prefer to use the new type. Any other opinions?
Personally, I'm a bit worried about consistency: seeing in the same file 
a mix of const_iterator and iterator spelled out and __pos_iterator. Can 
we completely avoid that? Also, I'm wondering if we could further 
optimize the names: from the modern, C++11 and C++14 point of view, 
__const_iterator would be better, or something like 
__cxx11_const_iterator, I don't know, __pos_iterator seems a little 
vague to me and lacking the *const* feature which somebody coming to the 
code without knowing the long history would definitely like to see in 
the name!

Paolo.



More information about the Libstdc++ mailing list