Go to the documentation of this file.
9 #ifndef EAGINE_VALID_IF_NOT_ZERO_HPP
10 #define EAGINE_VALID_IF_NOT_ZERO_HPP
23 return (value > T(0)) || (value < T(0));
27 template <
typename X,
typename = disable_if_same_t<X, do_log>>
28 constexpr do_log(X&&) noexcept {}
30 template <
typename Log>
32 log <<
"Value zero is invalid";
50 static inline auto nonzero(T v) noexcept ->
nonzero_t<T> {
56 #endif // EAGINE_VALID_IF_NOT_ZERO_HPP
Policy class for values valid if not equal to zero.
Definition: not_zero.hpp:19
Common code is placed in this namespace.
Definition: eagine.hpp:21
Primary template for conditionally valid values.
Definition: decl.hpp:49
constexpr auto operator()(T value) const noexcept
Indicates value validity, true if value != 0.
Definition: not_zero.hpp:22