From ed6115361006240e3c7b02295599e4534cc55a13 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 19 Oct 2013 08:57:20 +0200 Subject: Update internal Boost subset to 1.54.0 --- cutl/details/boost/regex/v4/cpp_regex_traits.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'cutl/details/boost/regex/v4/cpp_regex_traits.hpp') diff --git a/cutl/details/boost/regex/v4/cpp_regex_traits.hpp b/cutl/details/boost/regex/v4/cpp_regex_traits.hpp index 7281e84..654f668 100644 --- a/cutl/details/boost/regex/v4/cpp_regex_traits.hpp +++ b/cutl/details/boost/regex/v4/cpp_regex_traits.hpp @@ -1,7 +1,7 @@ /* * - * Copyright (c) 2004 - * John Maddock + * Copyright (c) 2004 John Maddock + * Copyright 2011 Garmin Ltd. or its subsidiaries * * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file @@ -20,6 +20,7 @@ #define BOOST_CPP_REGEX_TRAITS_HPP_INCLUDED #include +#include #ifndef BOOST_NO_STD_LOCALE @@ -107,12 +108,14 @@ template typename parser_buf::pos_type parser_buf::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) { + typedef typename cutl_details_boost::int_t::least cast_type; + if(which & ::std::ios_base::out) return pos_type(off_type(-1)); std::ptrdiff_t size = this->egptr() - this->eback(); std::ptrdiff_t pos = this->gptr() - this->eback(); charT* g = this->eback(); - switch(way) + switch(static_cast(way)) { case ::std::ios_base::beg: if((off < 0) || (off > size)) @@ -511,7 +514,9 @@ typename cpp_regex_traits_implementation::string_type // however at least one std lib will always throw // std::bad_alloc for certain arguments... // +#ifndef BOOST_NO_EXCEPTIONS try{ +#endif // // What we do here depends upon the format of the sort key returned by // sort key returned by this->transform: @@ -546,7 +551,9 @@ typename cpp_regex_traits_implementation::string_type result.erase(i); break; } +#ifndef BOOST_NO_EXCEPTIONS }catch(...){} +#endif while(result.size() && (charT(0) == *result.rbegin())) result.erase(result.size() - 1); if(result.empty()) @@ -576,7 +583,9 @@ typename cpp_regex_traits_implementation::string_type // std::bad_alloc for certain arguments... // string_type result; +#ifndef BOOST_NO_EXCEPTIONS try{ +#endif result = this->m_pcollate->transform(p1, p2); // // Borland's STLPort version returns a NULL-terminated @@ -593,10 +602,12 @@ typename cpp_regex_traits_implementation::string_type result.erase(result.size() - 1); #endif BOOST_ASSERT(std::find(result.begin(), result.end(), charT(0)) == result.end()); +#ifndef BOOST_NO_EXCEPTIONS } catch(...) { } +#endif return result; } -- cgit v1.1