Opened 11 years ago

Closed 11 years ago

#6121 closed Bugs (invalid)

Error: static_cast used instead of const_cast

Reported by: Antony Polukhin Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost Release Branch Severity: Regression
Keywords: Cc:

Description

/home/cc/downloads/boost_1_48_0_beta1/include/boost/range/iterator_range_core.hpp: In static member function ‘static IteratorT boost::iterator_range_detail::iterator_range_impl<IteratorT>::adl_begin(ForwardRange&) [with ForwardRange = const boost::iterator_range<const unsigned char*>, IteratorT = unsigned char*]’:
/home/cc/downloads/boost_1_48_0_beta1/include/boost/range/iterator_range_core.hpp:186:76:   instantiated from ‘boost::iterator_range<IteratorT>::iterator_range(const Range&) [with Range = boost::iterator_range<const unsigned char*>, IteratorT = unsigned char*]’
../../../../margot/applications/index24/xsd_lazy_types_string_t.hpp:49:17:   instantiated from here
/home/cc/downloads/boost_1_48_0_beta1/include/boost/range/iterator_range_core.hpp:56:66: error: invalid static_cast from type ‘boost::range_iterator<const boost::iterator_range<const unsigned char*> >::type {aka const unsigned char*}’ to type ‘unsigned char*’
/home/cc/downloads/boost_1_48_0_beta1/include/boost/range/iterator_range_core.hpp: In static member function ‘static IteratorT boost::iterator_range_detail::iterator_range_impl<IteratorT>::adl_end(ForwardRange&) [with ForwardRange = const boost::iterator_range<const unsigned char*>, IteratorT = unsigned char*]’:
/home/cc/downloads/boost_1_48_0_beta1/include/boost/range/iterator_range_core.hpp:186:76:   instantiated from ‘boost::iterator_range<IteratorT>::iterator_range(const Range&) [with Range = boost::iterator_range<const unsigned char*>, IteratorT = unsigned char*]’
../../../../margot/applications/index24/xsd_lazy_types_string_t.hpp:49:17:   instantiated from here
/home/cc/downloads/boost_1_48_0_beta1/include/boost/range/iterator_range_core.hpp:62:64: error: invalid static_cast from type ‘boost::range_iterator<const boost::iterator_range<const unsigned char*> >::type {aka const unsigned char*}’ to type ‘unsigned char*’
make: *** [../../../../margot/database/berkeleydb/bdb_database_indices.o] Error 1

Looks like there must be a const_cast instead of static_cast.
Code compiled and worked correctly in boost 1.46.1

Change History (1)

comment:1 by Antony Polukhin, 11 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.