Go to the documentation of this file.
9 #ifndef EAGINE_VALID_IF_WITHIN_LIMITS_HPP
10 #define EAGINE_VALID_IF_WITHIN_LIMITS_HPP
12 #include "../is_within_limits.hpp"
19 template <
typename Dst,
typename Src>
24 return is_within_limits<Dst>(value);
28 template <
typename X,
typename = disable_if_same_t<X, do_log>>
29 constexpr do_log(X&&) noexcept {}
31 template <
typename Log>
32 void operator()(Log& log,
const Src& v)
const {
33 log <<
"Value " << v <<
", "
34 <<
"not within limits of destination type "
44 template <
typename Dst,
typename Src>
50 #endif // EAGINE_VALID_IF_WITHIN_LIMITS_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
Primary template for conditionally valid values.
Definition: decl.hpp:49
Policy class for values valid if they are withing limits of other type.
Definition: within_limits.hpp:20
constexpr auto operator()(Src value) const noexcept
Indicates value validity, true if value fits into Dst type.
Definition: within_limits.hpp:23
valid_if< Src, valid_if_within_limits_policy< Dst, Src > > valid_if_within_limits
Specialization of valid_if, for values valid if within limits of Dst type.
Definition: within_limits.hpp:46