Function operator""_bound

Synopsis

#include <include/type_safe/bounded_type.hpp>

template <char... Digits>
constexpr auto operator""_bound() -> lit_detail::integer_bound< long long, detail::parse< long long, Digits... >()>

Description

Creates a static bound for [ts::bounded_type]().

This is a bound encapsulated in the type, so there is no overhead. You can use it for example like this ts::make_bounded(50, 0_bound, 100_bound), to bound an integer between 0 and 100.

Returns
A type representing the given value, the value has type long long (1)/unsigned long long(2). \group bound_lit

Source

Lines 372-377 in include/type_safe/bounded_type.hpp.

template <typename T, T Value>
constexpr T integer_bound<T, Value>::value;
template <typename T, T Value>
constexpr auto operator-(integer_bound<T, Value>) noexcept
    -> integer_bound<T, Value * T(-1)>





Add Discussion as Guest

Log in