xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd
number
xtd::number< value_t > Struct Template Reference
﹡ libraries
»
xtd.core
|
system
»
concepts
Definition
template<typename value_t>
struct xtd::number< value_t >
Represents the number concept alias.
Definition
template
<
typename
value_t>
concept
xtd::number
=
xtd::numeric<value_t>
;
xtd::number
Definition
number.hpp:11
xtd::numeric
Definition
numeric.hpp:12
Header
#include <xtd/number>
Namespace
xtd
Library
xtd.core
Examples
The following code shows how to use
xtd::number
concept
#include <xtd/xtd>
auto
print_is_number(
auto
value)
noexcept
{
println
(
"{} ({}) {} number"
, value, type_of(value),
number
<
decltype
(value)> ?
"is"
:
"is not"
);
}
auto
main() ->
int
{
print_is_number(42_s8);
print_is_number(42_s16);
print_is_number(42_s32);
print_is_number(42_s64);
print_is_number(42_u8);
print_is_number(42_u16);
print_is_number(42_u32);
print_is_number(42_u64);
print_is_number(42_z);
print_is_number(42.84f);
print_is_number(42.84);
print_is_number(42.84l);
print_is_number(
'a'
);
print_is_number(
true
);
print_is_number(
"string"
_s);
print_is_number(
"string"
);
print_is_number(1_h + 12_min + 24_s + 48_ms);
print_is_number(
day_of_week::wednesday
);
}
// This code produces the following output :
//
// 42 (signed char) is number
// 42 (short) is number
// 42 (int) is number
// 42 (long long) is number
// 42 (unsigned char) is number
// 42 (unsigned short) is number
// 42 (unsigned int) is number
// 42 (unsigned long long) is number
// 42 (unsigned long) is number
// 42.84 (float) is number
// 42.84 (double) is number
// 42.84 (long double) is number
// true (bool) is not number
// string (xtd::basic_string<char, std::char_traits<char>, std::allocator<char>>) is not number
// string (char const*) is not number
// 01:12:24.0480000 (xtd::time_span) is not number
// wednesday (xtd::day_of_week) is not number
xtd::day_of_week::wednesday
@ wednesday
Indicates wednesday.
Definition
day_of_week.hpp:33
xtd::println
auto println(FILE *file) -> void
Writes the current line terminator to the file output stream using the specified format information.
Definition
println.hpp:14
The documentation for this struct was generated from the following file:
xtd.core/include/xtd/
number_.hpp
Generated on
for xtd by
Gammasoft
. All rights reserved.