]> git.lyx.org Git - lyx.git/blobdiff - 3rdparty/boost/boost/regex/v4/regex_traits_defaults.hpp
Update boost to version 1.61
[lyx.git] / 3rdparty / boost / boost / regex / v4 / regex_traits_defaults.hpp
index a087d7844992145341d90cc697ffa6ec2a278910..1821883717beb16fbef726f77b37ffa6ad180898 100644 (file)
 #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