[ptr_container] ptr_begin & family

Hello, If I'm understanding the Boost.PointerContainer docs, ptr_begin(), ptr_end() etc. are provided so that certain mutating std algorithms can be used on pointer containers. But wouldn't it be more convenient to provide a memfun like ptr_iterator make_ptr_iterator(iterator); for obtaining a ptr_iterator from a regular iterator? This way, one could easily use std algorithms not only with [ptr_begin(),ptr_end()), but also with any other range (for instance, those obtained from equal_range()). With this memfun, the ptr_begin() familiy would be kind of redundant. Just an idea... Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

If I'm understanding the Boost.PointerContainer docs, ptr_begin(), ptr_end() etc. are provided so that certain mutating std algorithms can be used on pointer containers.
>>>>>>
docs need to be updated; ptr_begin() etc are history. But wouldn't it be more convenient to provide a memfun like ptr_iterator make_ptr_iterator(iterator); for obtaining a ptr_iterator from a regular iterator? This way, one could easily use std algorithms not only with [ptr_begin(),ptr_end()), but also with any other range (for instance, those obtained from equal_range()). With this memfun, the ptr_begin() familiy would be kind of redundant. Just an idea...
>>
the usability of ptr_begin() etc was severely reduced by the shift to a void* implementation; you can still get the original iterators are begin().base() etc, but just remember the reference type is void*&. and there is no way to provide a portable cast to T*&; it might work on 99% of all compilers, but it aint portable. -Thorsten
participants (2)
-
JOAQUIN LOPEZ MU?Z
-
Thorsten Ottosen