Ticket #2640: counting_iterator.hpp.patch

File counting_iterator.hpp.patch, 1010 bytes (added by schoedl, 13 years ago)

patch

  • ./VC/boost_1_42_0/boost/iterator/counting_iterator.hpp

     
    108107                 // criterion (see boost/iterator/detail/facade_iterator_category.hpp)
    109108# endif
    110109        , traversal
    111         , Incrementable const&                                    // reference
     110        , Incrementable                                                                                 // reference
     111                // boost ticket #2640: counting_iterator::reference lifetime tied to iterator
     112                // Counting_iterators must return copies because they only keep their current value in memory
     113                // Otherwise the following doesn't work:
     114                //              counting_iterator a;
     115                //              counting_iterator b=a;
     116                //              return *(--b);
     117                // This will return a reference to the Incrementable member of local variable b. reverse_iterator does just that.
    112118        , difference
    113119      > type;
    114120  };