ptr_map new iterators

I haven't tried 1.34 yet, but I have a vague memory that the iterators for ptr_map were changed to have the same interface as std::map. (So, for instance, the key for iter is accessed with iter->first, instead of iter.key()). Is this true? And if so, can this be added to the list of changes for 1.34? I didn't see it there, and this is an important change, since it will break a lot of code. Thanks. -Lewis

Lewis Hyatt skrev:
I haven't tried 1.34 yet, but I have a vague memory that the iterators for ptr_map were changed to have the same interface as std::map. (So, for instance, the key for iter is accessed with iter->first, instead of iter.key()). Is this true?
yes.
And if so, can this be added to the list of changes for 1.34? I didn't see it there, and this is an important change, since it will break a lot of code. Thanks.
it's not on the main boost page, but avaible here: http://www.boost.org/libs/ptr_container/doc/ptr_container.html#upgrading-fro... -Thorsten

On May 23, 2007, at 11:26 AM, Thorsten Ottosen wrote:
And if so, can this be added to the list of changes for 1.34? I didn't see it there, and this is an important change, since it will break a lot of code. Thanks.
it's not on the main boost page, but avaible here:
http://www.boost.org/libs/ptr_container/doc/ ptr_container.html#upgrading-from-boost-v-1-33
This is the kind of thing that needs to go on the front page, to alert users. Could you prepare a patch to the front page in RC_1_34_0, open a Trac ticket, etc., so that Boost 1.34.1 will have the appropriate documentation? - Doug

Doug Gregor wrote:
On May 23, 2007, at 11:26 AM, Thorsten Ottosen wrote:
And if so, can this be added to the list of changes for 1.34? I didn't see it there, and this is an important change, since it will break a lot of code. Thanks.
it's not on the main boost page, but avaible here:
http://www.boost.org/libs/ptr_container/doc/ ptr_container.html#upgrading-from-boost-v-1-33
This is the kind of thing that needs to go on the front page, to alert users. Could you prepare a patch to the front page in RC_1_34_0, open a Trac ticket, etc., so that Boost 1.34.1 will have the appropriate documentation?
OK great, thanks. I agree that the change was a good one, I just think it needs to be more visible because I would never have known about it if I hadn't caught something on the list a few months ago. And, if people happen to be using ptr_map with a value_type of std::pair, this can be a silent breaking change. (It happened to me!) -Lewis

On 23/05/07, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
Lewis Hyatt skrev:
I haven't tried 1.34 yet, but I have a vague memory that the iterators for ptr_map were changed to have the same interface as std::map. (So, for instance, the key for iter is accessed with iter->first, instead of iter.key()). Is this true?
yes.
I didn't realise this had ended up in 1.34 - that's great! I know this is a little cheeky..but any chance of getting my name on the acknowledgements? I suggested it I think, and implementation of ptr_map_iterator/ref_pair looks very similar to the iterator/proxy classes I posted eighteen months ago. http://lists.boost.org/Archives/boost/2006/01/98961.php Ta Sam

Sam Partington skrev:
On 23/05/07, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
Lewis Hyatt skrev:
I haven't tried 1.34 yet, but I have a vague memory that the iterators for ptr_map were changed to have the same interface as std::map. (So, for instance, the key for iter is accessed with iter->first, instead of iter.key()). Is this true?
yes.
I didn't realise this had ended up in 1.34 - that's great!
I know this is a little cheeky..but any chance of getting my name on the acknowledgements? I suggested it I think, and implementation of ptr_map_iterator/ref_pair looks very similar to the iterator/proxy classes I posted eighteen months ago.
Indeed it does. :-) I'll see what I can do when I get some time. -Thorsten
participants (4)
-
Doug Gregor
-
Lewis Hyatt
-
Sam Partington
-
Thorsten Ottosen