Ticket #8716: boost_utility_string_ref.patch

File boost_utility_string_ref.patch, 1.6 KB (added by Adam Romanek <romanek.adam@…>, 9 years ago)
  • boost/utility/string_ref.hpp

    diff -Naur .build/boost_1_53_0/boost/utility/string_ref.hpp .build/boost_1_53_0_patched/boost/utility/string_ref.hpp
    old new  
    1717
    1818#include <boost/config.hpp>
    1919#include <boost/detail/workaround.hpp>
     20#include <boost/throw_exception.hpp>
    2021
    2122#include <stdexcept>
    2223#include <algorithm>
     
    115116
    116117        const charT& at(size_t pos) const {
    117118            if ( pos >= len_ )
    118                 throw std::out_of_range ( "boost::string_ref::at" );
     119                throw_exception( std::out_of_range ( "boost::string_ref::at" ) );
    119120            return ptr_[pos];
    120121            }
    121122           
     
    145146#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
    146147            // Looks like msvc 8 and 9 have a codegen bug when one branch of
    147148            // a conditional operator is a throw expression. -EAN 2012/12/04
    148             if ( pos > size()) throw std::out_of_range ( "string_ref::substr" );
     149            if ( pos > size()) throw_exception( std::out_of_range ( "string_ref::substr" ) );
    149150            if ( n == npos || pos + n > size()) n = size () - pos;
    150151            return basic_string_ref ( data() + pos, n );
    151152#else
    152             return pos > size() ? throw std::out_of_range ( "string_ref::substr" ) :
     153            return pos > size() ? throw_exception( std::out_of_range ( "string_ref::substr" ) ) :
    153154                basic_string_ref ( data() + pos, n == npos || pos + n > size() ? size() - pos : n );
    154155#endif
    155156            }