xtd 0.2.0
Loading...
Searching...
No Matches
xtd::textual< type_t > Struct Template Reference

Definition

template<class type_t>
struct xtd::textual< type_t >

Represents the textual concept.

Definition
template<class value_t>
concept xtd::textual = std::same_as<xtd::raw_type<type_t>, std::string> || std::same_as<xtd::raw_type<type_t>, std::u16string> || std::same_as<xtd::raw_type<type_t>, std::u32string> || std::same_as<xtd::raw_type<type_t>, std::u8string> || std::same_as<xtd::raw_type<type_t>, std::wstring> || std::same_as<xtd::raw_type<type_t>, xtd::string> || std::same_as<xtd::raw_type<type_t>, xtd::u16string> || std::same_as<xtd::raw_type<type_t>, xtd::u32string> || std::same_as<xtd::raw_type<type_t>, xtd::u8string> || std::same_as<xtd::raw_type<type_t>, xtd::wstring> || xtd::textual_literal<type_t>;
Definition textual_literal.hpp:17
Definition textual.hpp:18
xtd::basic_string< xtd::char8 > u8string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:76
xtd::basic_string< xtd::char32 > u32string
Represents text as a sequence of UTF-32 code units.
Definition __string_definitions.hpp:65
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::basic_string< xtd::char16 > u16string
Represents text as a sequence of UTF-16 code units.
Definition __string_definitions.hpp:54
xtd::basic_string< xtd::wchar > wstring
Represents text as a sequence of UTF-16 code unit on Windows or UTF-32 code unit on non-Windows syste...
Definition __string_definitions.hpp:87
Header
#include <xtd/textual>
Namespace
xtd
Library
xtd.core
Examples
The following code shows how to use xtd::textual concept
#include <xtd/xtd>
auto print_is_textual(auto value) noexcept {
println("{} ({}) {} textual", value, type_of(value), textual<decltype(value)> ? "is" : "is not");
}
auto main() -> int {
print_is_textual(42_s8);
print_is_textual(42_s16);
print_is_textual(42_s32);
print_is_textual(42_s64);
print_is_textual(42_u8);
print_is_textual(42_u16);
print_is_textual(42_u32);
print_is_textual(42_u64);
print_is_textual(42_z);
print_is_textual(42.84f);
print_is_textual(42.84);
print_is_textual(42.84l);
print_is_textual('a');
print_is_textual(true);
print_is_textual("string"_s);
print_is_textual("string");
print_is_textual(1_h + 12_min + 24_s + 48_ms);
print_is_textual(day_of_week::wednesday);
}
// This code produces the following output :
//
// 42 (signed char) is not textual
// 42 (short) is not textual
// 42 (int) is not textual
// 42 (long long) is not textual
// 42 (unsigned char) is not textual
// 42 (unsigned short) is not textual
// 42 (unsigned int) is not textual
// 42 (unsigned long long) is not textual
// 42 (unsigned long) is not textual
// 42.84 (float) is not textual
// 42.84 (double) is not textual
// 42.84 (long double) is not textual
// true (bool) is not textual
// string (xtd::basic_string<char, std::char_traits<char>, std::allocator<char>>) is textual
// string (char const*) is textual
// 01:12:24.0480000 (xtd::time_span) is not textual
// wednesday (xtd::day_of_week) is not textual
@ wednesday
Indicates wednesday.
Definition day_of_week.hpp:33
void println()
Writes the current line terminator to the standard output stream using the specified format informati...
Definition println.hpp:167

The documentation for this struct was generated from the following file: