1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <locale> 11 12 // template <> class ctype<char>; 13 14 // const char* toupper(char* low, const char* high) const; 15 16 #include <locale> 17 #include <string> 18 #include <cassert> 19 20 int main() 21 { 22 std::locale l = std::locale::classic(); 23 { 24 typedef std::ctype<char> F; 25 const F& f = std::use_facet<F>(l); 26 std::string in(" A\x07.a1"); 27 28 assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size()); 29 assert(in[0] == ' '); 30 assert(in[1] == 'A'); 31 assert(in[2] == '\x07'); 32 assert(in[3] == '.'); 33 assert(in[4] == 'A'); 34 assert(in[5] == '1'); 35 } 36 } 37