Opened 15 years ago
Closed 15 years ago
#1327 closed Bugs (fixed)
iterator value_type possibly cv-qualified
| Reported by: | 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)
follow-ups: 2 3 comment:1 by , 15 years ago
comment:2 by , 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
comment:3 by , 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
  Note:
 See   TracTickets
 for help on using tickets.
    

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