date_order_wide.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <locale>
11
12// class time_get_byname<charT, InputIterator>
13
14// dateorder date_order() const;
15
16#include <locale>
17#include <cassert>
18#include "iterators.h"
19
20typedef std::time_get_byname<wchar_t, input_iterator<const wchar_t*> > F;
21
22class my_facet
23    : public F
24{
25public:
26    explicit my_facet(const std::string& nm, std::size_t refs = 0)
27        : F(nm, refs) {}
28};
29
30int main()
31{
32    {
33        const my_facet f("en_US", 1);
34        assert(f.date_order() == std::time_base::mdy);
35    }
36    {
37        const my_facet f("fr_FR", 1);
38        assert(f.date_order() == std::time_base::dmy);
39    }
40    {
41        const my_facet f("ru_RU", 1);
42        assert(f.date_order() == std::time_base::dmy);
43    }
44    {
45        const my_facet f("zh_CN", 1);
46        assert(f.date_order() == std::time_base::ymd);
47    }
48}
49