Ticket #4649: token_functions.patch
File token_functions.patch, 2.0 KB (added by , 12 years ago) |
---|
-
C:/boost/boost_1_45_0/boost/token_functions
old new 211 211 // expect an int. 212 212 // In case there is no cwctype header, we implement the checks manually. 213 213 // We make use of the fact that the tested categories should fit in ASCII. 214 215 #if !defined(BOOST_NO_CWCTYPE) 216 template<typename traits, int N> 217 struct traits_extension_details : public traits { 218 typedef typename traits::char_type char_type; 219 static bool isspace(char_type c) 220 { 221 return std::iswspace(c) != 0; 222 } 223 static bool ispunct(char_type c) 224 { 225 return std::iswpunct(c) != 0; 226 } 227 }; 228 template<typename traits> 229 struct traits_extension_details<typename traits, 1> : public traits { 230 typedef typename traits::char_type char_type; 231 static bool isspace(char_type c) 232 { 233 return std::isspace(c) != 0; 234 } 235 static bool ispunct(char_type c) 236 { 237 return std::ispunct(c) != 0; 238 } 239 }; 240 #endif 241 214 242 template<typename traits> 215 243 struct traits_extension : public traits { 216 244 typedef typename traits::char_type char_type; 217 245 static bool isspace(char_type c) 218 246 { 219 247 #if !defined(BOOST_NO_CWCTYPE) 220 if (sizeof(char_type) == 1) 221 return std::isspace(c) != 0; 222 else 223 return std::iswspace(c) != 0; 248 return traits_extension_details<traits, sizeof(char_type)>::isspace(c); 224 249 #else 225 250 return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0; 226 251 #endif … … 229 254 static bool ispunct(char_type c) 230 255 { 231 256 #if !defined(BOOST_NO_CWCTYPE) 232 if (sizeof(char_type) == 1) 233 return std::ispunct(c) != 0; 234 else 235 return std::iswpunct(c) != 0; 257 return traits_extension_details<traits, sizeof(char_type)>::ispunct(c); 236 258 #else 237 259 return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0; 238 260 #endif