1 // POD character, std::char_traits specialization -*- C++ -*-
3 // Copyright (C) 2002-2017 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
21 // Gabriel Dos Reis <gdr@integrable-solutions.net>
22 // Benjamin Kosnik <bkoz@redhat.com>
24 #include <ext/pod_char_traits.h>
28 using namespace __gnu_cxx
;
30 typedef unsigned short value_type
;
31 typedef unsigned int int_type
;
32 typedef character
<value_type
, int_type
> char_type
;
33 typedef std::char_traits
<char_type
> traits_type
;
37 // 1 char_type <-> value_type conversions
40 char_type c1
= { uc1
};
41 char_type c2
= { uc2
};
45 test
= traits_type::eq(c1
, c2
);
47 // 3 basic_string<char_type>
48 typedef std::basic_string
<char_type
> string_type
;
50 char_type c3
= { value_type('b') };
51 char_type c4
= { value_type('o') };
52 char_type c5
= { value_type('r') };
53 char_type c6
= { value_type('a') };
54 char_type c7
= { value_type('c') };
55 char_type c8
= { value_type('a') };
56 char_type c9
= { value_type('y') };
64 string_type::size_type len
__attribute__((unused
)) = str
.size();
65 const char_type
* arr
__attribute__((unused
)) = str
.c_str();