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

Definition

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

Represents the incrementable concept.

Definition
template<typename type_t>
concept xtd::incrementable = xxtd::post_incrementable<type_t> && xtd::pre_incrementable<type_t>;
Definition incrementable.hpp:12
Definition pre_incrementable.hpp:12
Header
#include <xtd/incrementable>
Namespace
xtd
Library
xtd.core
Examples
The following code shows how to use xtd::incrementable concept
#include <xtd/xtd>
auto print_is_incrementable(auto value) noexcept {
println("{} ({}) {} incrementable", value, type_of(value), incrementable<decltype(value)> ? "is" : "is not");
}
auto main() -> int {
print_is_incrementable(42);
print_is_incrementable(time_span {1, 2, 3});
print_is_incrementable(version {1, 2, 3});
}
// This code produces the following output :
//
// 42 (int) is incrementable
// 01:02:03 (xtd::time_span) is incrementable
// 1.2.3 (xtd::version) is not 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: