Opened 15 years ago

Closed 15 years ago

#1327 closed Bugs (fixed)

iterator value_type possibly cv-qualified

Reported by: Shunsuke Sogame <pstade.mb@…> Owned by: Thorsten Ottosen
Milestone: Boost 1.35.0 Component: ptr_container
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

boost::ptr_vector<int const>::iterator::value_type

is int const now, but it should be int.

Change History (4)

comment:1 by Thorsten Ottosen, 15 years ago

AFAICT, you can't even use boost::ptr_vector<int const>, because the whole library has not been designed/tested with this in mind.

Standard containers don't support this. Can you describe why it is useful?

-Thorsten

in reply to:  1 comment:2 by Shunsuke Sogame <pstade.mb@…>, 15 years ago

Replying to nesotto:

the whole library has not been designed/tested with this in mind.

I didn't know that. Sorry for the noise.

-- Shunsuke Sogame

in reply to:  1 comment:3 by Shunsuke Sogame <pstade.mb@…>, 15 years ago

Replying to nesotto:

AFAICT, you can't even use boost::ptr_vector<int const>, because the whole library has not been designed/tested with this in mind.

Sorry again.

See this:

#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/mpl/assert.hpp>

int main()
{
    typedef boost::range_const_iterator< boost::ptr_vector<int> >::type citer_t;
    BOOST_MPL_ASSERT((boost::is_same<citer_t::value_type, int const>)); // pass
    BOOST_MPL_ASSERT((boost::is_same<citer_t::value_type, int>)); // failed
}

This seems a bug.

--

Shunsuke Sogame

comment:4 by Thorsten Ottosen, 15 years ago

Resolution: fixed
Status: newclosed

Should be fixed...

Note: See TracTickets for help on using tickets.