1 #pragma once // Source encoding: UTF-8 with BOM (π is a lowercase Greek "pi"). 11 #include <string_view> 12 #include <string_view> 25 template<
class Char >
28 template<>
struct Char_type_id_<char>{
enum{ value = 0 }; };
29 template<>
struct Char_type_id_<wchar_t>{
enum{ value = 1 }; };
30 template<>
struct Char_type_id_<char16_t>{
enum{ value = 2 }; };
31 template<>
struct Char_type_id_<char32_t>{
enum{ value = 3 }; };
33 template<
class Char >
34 constexpr
int char_type_id_ = Char_type_id_<Char>::value;
38 template<
class Char >
46 << (*type_spec?
"( " :
"")
47 << prefixes[impl::char_type_id_<Char>]
49 for(
const Char wch : ws )
51 if(
' ' < wch and wch < 127 )
59 << std::hex << std::setfill(
'0' )
60 << std::setw( 2*
sizeof(
wchar_t ) ) << unsigned( wch )
61 << std::setfill(
' ' ) << std::dec
62 <<
"\" " << prefixes[impl::char_type_id_<Char>] <<
"\"";
65 os <<
"\"" << (*type_spec?
" )" :
"");
87 {
return cppx::boost_fix::print_on<wchar_t>( os,
"wstring", ws ); }
91 {
return cppx::boost_fix::print_on<char16_t>( os,
"u16string", ws ); }
95 {
return cppx::boost_fix::print_on<char32_t>( os,
"u32string", ws ); }
99 {
return cppx::boost_fix::print_on<wchar_t>( os,
"", ws ); }
103 {
return cppx::boost_fix::print_on<char16_t>( os,
"", ws ); }
107 {
return cppx::boost_fix::print_on<char32_t>( os,
"", ws ); }
Some_type * P_
Creates a raw pointer type.
auto print_on(ostream &os, const P_< const char > type_spec, const basic_string_view< Char > &ws) -> ostream &
auto boost_test_print_type(ostream &os, const cppx::P_< char32_t > ws) -> ostream &
CPPX_USE_STD(ostream, basic_string_view)
Simple type builders Type_, P_, R_, Raw_array_ and Raw_array_of_.
Item[] Raw_array_
Ceates a raw array type of unknown size.
Macros for generating more concise and clear using statements, primarily $use_cppx and $use_std,...