|
Boost : |
From: Dan Eloff (dan.eloff_at_[hidden])
Date: 2004-09-03 00:27:31
>For things like this the solution is usually to store the
>dereferenced value inside the iterator itself. You might look into
>using boost::optional for efficiency in this case.
If I store it in the iterator I get crashes because a reference is
floating around to the long dead temporary iterator returned from post
increment. I can store it in the parent (container) class of the
iterator ( what I do now anyway ) but I need to store two values with
post increment.
>I'm not sure there _is_ a good reason. If you'd like to patch it to
>do it the other way, and if all of the Boost.Python regression tests
>still pass, I'll apply your patch.
If only so nobody else will have to go through what I just did today
and yesterday I will make the patch. I'll post to the C++-sig when
I've got it.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk