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

Definition

template<typename type_t>
struct xtd::pre_incrementable< type_t >

Represents the post decrementable concept.

Definition
template<typename type_t>
concept xtd::pre_incrementable = requires(xtd::raw_type<type_t>& a) {{++a} -> std::same_as<xtd::raw_type<type_t>>;}
Definition pre_incrementable.hpp:12
std::remove_cvref_t< value_t > raw_type
Represents a raw type alias equivalent to std::remove_cvref_t<value_t>.
Definition raw_type.hpp:25
@ a
The A key.
Definition console_key.hpp:88
Header
#include <xtd/pre_incrementable>
Namespace
xtd
Library
xtd.core
Examples
The following code shows how to use xtd::pre_incrementable concept
#include <xtd/xtd>
auto print_is_pre_incrementable(auto value) noexcept {
println("{} ({}) {} pre_incrementable", value, type_of(value), pre_incrementable<decltype(value)> ? "is" : "is not");
}
auto main() -> int {
print_is_pre_incrementable(42);
print_is_pre_incrementable(time_span {1, 2, 3});
print_is_pre_incrementable(version {1, 2, 3});
}
// This code produces the following output :
//
// 42 (int) is pre_incrementable
// 01:02:03 (xtd::time_span) is pre_incrementable
// 1.2.3 (xtd::version) is not pre_incrementable
Represents a time interval.
Definition time_span.hpp:29
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: