]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/test/concepts/test_bug_11988.cpp
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 #include <boost/config.hpp>
14 #ifndef BOOST_NO_CXX11_CHAR32_T
20 std::size_t hash_value(char32_t
const& c
) { return c
; }
24 #include <boost/regex.hpp>
28 typedef char32_t char_type
;
29 typedef std::size_t size_type
;
30 typedef std::vector
<char32_t
> string_type
;
31 typedef int locale_type
; // not used
32 typedef unsigned char_class_type
;
34 static size_type
length(const char32_t
* p
)
44 static char_type
translate(char_type c
) { return c
; }
45 static char_type
translate_nocase(char_type c
) { return c
; }
46 static string_type
transform(const char32_t
* p1
, const char32_t
* p2
)
48 return string_type(p1
, p2
);
50 static string_type
transform_primary(const char32_t
* p1
, const char32_t
* p2
)
52 return string_type(p1
, p2
);
54 static char_class_type
lookup_classname(const char32_t
* p1
, const char32_t
* p2
)
56 std::string
s(p1
, p2
);
57 return boost::c_regex_traits
<char>::lookup_classname(s
.c_str(), s
.c_str() + s
.length());
60 static string_type
lookup_collatename(const char32_t
* p1
, const char32_t
* p2
)
62 return string_type(p1
, p2
);
64 static bool isctype(char_type c
, char_class_type t
)
67 return boost::c_regex_traits
<char>::isctype(c
, t
);
70 static boost::intmax_t value(char_type c
, int radix
)
75 if((c
>= '0') && (c
<= '7'))
79 if((c
>= '0') && (c
<= '9'))
83 if((c
>= '0') && (c
<= '9'))
85 if((c
>= 'a') && (c
<= 'f'))
86 return (c
- 'a') + 10;
87 if((c
>= 'A') && (c
<= 'F'))
88 return (c
- 'A') + 10;
93 static locale_type
imbue(locale_type
) { return 0; }
94 static locale_type
getloc() { return 0; }
100 char32_t big_char
[] = { 0xF, 0xFF, 0xFFF, 0xFFFF, 0xFFFFF, 0xFFFFFF, 0xFFFFFFF, 0xFFFFFFFF, 0 };
102 boost::basic_regex
<char32_t
, char32_traits
> e(U
"\\x{F}\\x{FF}\\x{FFF}\\x{FFFF}\\x{FFFFF}\\x{FFFFFF}\\x{FFFFFFF}\\x{FFFFFFFF}");
104 if(!regex_match(big_char
, e
))
113 int main() { return 0; }