summaryrefslogtreecommitdiffstats
path: root/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp
blob: fc267cebd7a2e9cad5473c2fd1dd191c489d266c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <locale>

// class ctype_base
// { 
// public: 
//     typedef T mask; 
// 
//     // numeric values are for exposition only. 
//     static const mask space = 1 << 0; 
//     static const mask print = 1 << 1; 
//     static const mask cntrl = 1 << 2; 
//     static const mask upper = 1 << 3; 
//     static const mask lower = 1 << 4; 
//     static const mask alpha = 1 << 5; 
//     static const mask digit = 1 << 6; 
//     static const mask punct = 1 << 7; 
//     static const mask xdigit = 1 << 8; 
//     static const mask alnum = alpha | digit; 
//     static const mask graph = alnum | punct; 
// };

#include <locale>
#include <cassert>

int main()
{
    assert(std::ctype_base::space);
    assert(std::ctype_base::print);
    assert(std::ctype_base::cntrl);
    assert(std::ctype_base::upper);
    assert(std::ctype_base::lower);
    assert(std::ctype_base::alpha);
    assert(std::ctype_base::digit);
    assert(std::ctype_base::punct);
    assert(std::ctype_base::xdigit);
    assert(
      ( std::ctype_base::space
      & std::ctype_base::print
      & std::ctype_base::cntrl
      & std::ctype_base::upper
      & std::ctype_base::lower
      & std::ctype_base::alpha
      & std::ctype_base::digit
      & std::ctype_base::punct
      & std::ctype_base::xdigit) == 0);
    assert(std::ctype_base::alnum == (std::ctype_base::alpha | std::ctype_base::digit));
    assert(std::ctype_base::graph == (std::ctype_base::alnum | std::ctype_base::punct));
}