2010-08-13 20:11:23 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-08-13 20:11:23 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <regex>
|
|
|
|
|
|
|
|
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
|
|
|
|
|
|
|
// locale_type imbue(locale_type loc);
|
|
|
|
|
|
|
|
#include <regex>
|
|
|
|
#include <locale>
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
std::regex r;
|
2011-09-21 19:38:03 +02:00
|
|
|
std::locale loc = r.imbue(std::locale("en_US.UTF-8"));
|
2010-08-13 20:11:23 +02:00
|
|
|
assert(loc.name() == "C");
|
2011-09-21 19:38:03 +02:00
|
|
|
assert(r.getloc().name() == "en_US.UTF-8");
|
2010-08-13 20:11:23 +02:00
|
|
|
loc = r.imbue(std::locale("C"));
|
2011-09-21 19:38:03 +02:00
|
|
|
assert(loc.name() == "en_US.UTF-8");
|
2010-08-13 20:11:23 +02:00
|
|
|
assert(r.getloc().name() == "C");
|
|
|
|
}
|