--- C:/boost/boost_1_45_0/boost/token_functions - old.hpp Thu Aug 19 21:06:52 2010 +++ C:/boost/boost_1_45_0/boost/token_functions.hpp Mon Jan 17 18:43:06 2011 @@ -211,16 +211,41 @@ // expect an int. // 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. + +#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 + template struct traits_extension : public traits { typedef typename traits::char_type char_type; 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 +254,7 @@ 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