diff options
Diffstat (limited to 'boost/regex/v4/regex_traits_defaults.hpp')
-rw-r--r-- | boost/regex/v4/regex_traits_defaults.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/boost/regex/v4/regex_traits_defaults.hpp b/boost/regex/v4/regex_traits_defaults.hpp index a087d78449..1821883717 100644 --- a/boost/regex/v4/regex_traits_defaults.hpp +++ b/boost/regex/v4/regex_traits_defaults.hpp @@ -30,12 +30,15 @@ #pragma warning(pop) #endif +#include <boost/regex/config.hpp> + #ifndef BOOST_REGEX_SYNTAX_TYPE_HPP #include <boost/regex/v4/syntax_type.hpp> #endif #ifndef BOOST_REGEX_ERROR_TYPE_HPP #include <boost/regex/v4/error_type.hpp> #endif +#include <boost/type_traits/make_unsigned.hpp> #ifdef BOOST_NO_STDC_NAMESPACE namespace std{ @@ -43,7 +46,7 @@ namespace std{ } #endif -namespace boost{ namespace re_detail{ +namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ // @@ -51,7 +54,10 @@ namespace boost{ namespace re_detail{ // template <class charT> inline bool is_extended(charT c) -{ return c > 256; } +{ + typedef typename make_unsigned<charT>::type unsigned_type; + return (sizeof(charT) > 1) && (static_cast<unsigned_type>(c) >= 256u); +} inline bool is_extended(char) { return false; } @@ -153,7 +159,7 @@ struct character_pointer_range // calling std::equal, but there is no other algorithm available: // not even a non-standard MS one. So forward to unchecked_equal // in the MS case. - return ((p2 - p1) == (r.p2 - r.p1)) && re_detail::equal(p1, p2, r.p1); + return ((p2 - p1) == (r.p2 - r.p1)) && BOOST_REGEX_DETAIL_NS::equal(p1, p2, r.p1); } }; template <class charT> @@ -354,7 +360,7 @@ inline const char* get_escape_R_string<char>() #endif } -} // re_detail +} // BOOST_REGEX_DETAIL_NS } // boost #ifdef BOOST_MSVC |