category.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
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// typedef int category;
13
14#include <locale>
15#include <type_traits>
16#include <cassert>
17
18int main()
19{
20    static_assert((std::is_same<std::locale::category, int>::value), "");
21    assert(std::locale::none == 0);
22    assert(std::locale::collate);
23    assert(std::locale::ctype);
24    assert(std::locale::monetary);
25    assert(std::locale::numeric);
26    assert(std::locale::time);
27    assert(std::locale::messages);
28    assert((std::locale::collate
29          & std::locale::ctype
30          & std::locale::monetary
31          & std::locale::numeric
32          & std::locale::time
33          & std::locale::messages) == 0);
34    assert((std::locale::collate
35          | std::locale::ctype
36          | std::locale::monetary
37          | std::locale::numeric
38          | std::locale::time
39          | std::locale::messages)
40         == std::locale::all);
41}
42