[Boost-bugs] [Boost C++ Libraries] #6121: Error: static_cast used instead of const_cast

Subject: [Boost-bugs] [Boost C++ Libraries] #6121: Error: static_cast used instead of const_cast
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-13 09:38:03


#6121: Error: static_cast used instead of const_cast
----------------------------------+-----------------------------------------
 Reporter: apolukhin | Owner: neilgroves
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
  Version: Boost Release Branch | Severity: Regression
 Keywords: |
----------------------------------+-----------------------------------------
 {{{
 /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.[[BR]]
 Code compiled and worked correctly in boost 1.46.1

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6121>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC