Modify

Opened 10 years ago

Closed 10 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.

Attachments (0)

Change History (4)

comment:1 Changed 10 years ago by Thorsten Ottosen

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

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

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

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

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 Changed 10 years ago by Thorsten Ottosen

Resolution: fixed
Status: newclosed

Should be fixed...

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Thorsten Ottosen.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.