X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Ftoken_functions.hpp;h=4d1a1dfcfbd9df49cc46a88235adee6297238c9b;hb=c48091f33a773732fa6c789927e5833e44108d9d;hp=57d2954c0af924c37f75eafab06d7acd1d58f31d;hpb=228c1d22e426e4a97b63a40dcf10a51da0efbf9d;p=lyx.git diff --git a/boost/boost/token_functions.hpp b/boost/boost/token_functions.hpp index 57d2954c0a..4d1a1dfcfb 100644 --- a/boost/boost/token_functions.hpp +++ b/boost/boost/token_functions.hpp @@ -209,6 +209,36 @@ namespace boost{ // Assuming that the conditional will always get optimized out in the function // implementations, argument types are not a problem since both forms of character classifiers // expect an int. + +#if !defined(BOOST_NO_CWCTYPE) + template + struct traits_extension_details : public traits { + typedef typename traits::char_type char_type; + static bool isspace(char_type c) + { + return std::iswspace(c) != 0; + } + static bool ispunct(char_type c) + { + return std::iswpunct(c) != 0; + } + }; + + template + struct traits_extension_details : public traits { + typedef typename traits::char_type char_type; + static bool isspace(char_type c) + { + return std::isspace(c) != 0; + } + static bool ispunct(char_type c) + { + return std::ispunct(c) != 0; + } + }; +#endif + + // In case there is no cwctype header, we implement the checks manually. // We make use of the fact that the tested categories should fit in ASCII. template @@ -217,10 +247,7 @@ namespace boost{ static bool isspace(char_type c) { #if !defined(BOOST_NO_CWCTYPE) - if (sizeof(char_type) == 1) - return std::isspace(c) != 0; - else - return std::iswspace(c) != 0; + return traits_extension_details::isspace(c); #else return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0; #endif @@ -229,10 +256,7 @@ namespace boost{ static bool ispunct(char_type c) { #if !defined(BOOST_NO_CWCTYPE) - if (sizeof(char_type) == 1) - return std::ispunct(c) != 0; - else - return std::iswpunct(c) != 0; + return traits_extension_details::ispunct(c); #else return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0; #endif @@ -418,7 +442,7 @@ namespace boost{ class char_separator { typedef tokenizer_detail::traits_extension Traits; - typedef std::basic_string string_type; + typedef std::basic_string string_type; public: explicit char_separator(const Char* dropped_delims, @@ -561,7 +585,7 @@ namespace boost{ private: typedef tokenizer_detail::traits_extension Traits; - typedef std::basic_string string_type; + typedef std::basic_string string_type; string_type returnable_; string_type nonreturnable_; bool return_delims_;