Function make_bounded_exclusive

Synopsis

#include <include/type_safe/bounded_type.hpp>

template <typename T, typename U1, typename U2>
constexpr auto make_bounded_exclusive(T &&value, U1 &&lower, U2 &&upper) -> detail::make_bounded_type< assertion_verifier, false, false, T, U1, U2 >

Description

Creates a [ts::bounded_type]() to a specified [ts::constraints::open_interval]().

Returns
A [ts::bounded_type]() with the given value and lower and upper bounds, where the bounds are not valid values. \requires As it uses [ts::assertion_verifier](), the value must be valid. \notes If this function is passed in dynamic values of the same type as value, it will create a dynamic bound. Otherwise it must be passed static bounds.

Source

Lines 436-443 in include/type_safe/bounded_type.hpp.

/// Otherwise it must be passed static bounds.
template <typename T, typename U1, typename U2>
constexpr auto sanitize_bounded(T&& value, U1&& lower, U2&& upper)
    -> detail::make_bounded_type<throwing_verifier, true, true, T, U1, U2>
{
    using result_type = detail::make_bounded_type<throwing_verifier, true, true, T, U1, U2>;
    return result_type(std::forward<T>(value),
                       typename result_type::constraint_predicate(std::forward<U1>(lower),





Add Discussion as Guest

Log in