Boost C++ Libraries: Ticket #6121: Error: static_cast used instead of const_cast https://svn.boost.org/trac10/ticket/6121 <pre class="wiki">/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&lt;IteratorT&gt;::adl_begin(ForwardRange&amp;) [with ForwardRange = const boost::iterator_range&lt;const unsigned char*&gt;, 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&lt;IteratorT&gt;::iterator_range(const Range&amp;) [with Range = boost::iterator_range&lt;const unsigned char*&gt;, 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&lt;const boost::iterator_range&lt;const unsigned char*&gt; &gt;::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&lt;IteratorT&gt;::adl_end(ForwardRange&amp;) [with ForwardRange = const boost::iterator_range&lt;const unsigned char*&gt;, 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&lt;IteratorT&gt;::iterator_range(const Range&amp;) [with Range = boost::iterator_range&lt;const unsigned char*&gt;, 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&lt;const boost::iterator_range&lt;const unsigned char*&gt; &gt;::type {aka const unsigned char*}’ to type ‘unsigned char*’ make: *** [../../../../margot/database/berkeleydb/bdb_database_indices.o] Error 1 </pre><p> Looks like there must be a const_cast instead of static_cast.<br /> Code compiled and worked correctly in boost 1.46.1 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6121 Trac 1.4.3 Antony Polukhin Tue, 15 Nov 2011 17:03:14 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6121#comment:1 https://svn.boost.org/trac10/ticket/6121#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket