template < utx::kspt::real_number T, utx::kspt::real_number U, utx::kspt::real_number V > inline constexpr bool utx::in_scope(const T & x, const U & a, const V & b);
Check if x is in scope [a, b], including a and b.
template < utx::kspt::real_number T, utx::kspt::real_number U, utx::kspt::real_number V > inline constexpr bool utx::lt_scope(const T & x, const U & a, const V & b);
Check if x is not in scope [a, b] and less than a and b.
template < utx::kspt::real_number T, utx::kspt::real_number U, utx::kspt::real_number V > inline constexpr bool utx::gt_scope(const T & x, const U & a, const V & b);
Check if x is not in scope [a, b] and greater than a and b.
#include <utxcpp/core.hpp> #include <numbers> int main() { constexpr utx::i32 x = -123; constexpr utx::u16 y = 321; constexpr utx::f64 z = std::numbers::pi; constexpr utx::u32 w = 321; static_assert(utx::in_scope(z, x, y)); static_assert(utx::lt_scope(x, y, z)); static_assert(utx::gt_scope(w, x, z)); static_assert(utx::in_scope(w, x, y)); static_assert(utx::in_scope(w, y, x)); static_assert(!utx::gt_scope(w, x, y)); static_assert(!utx::lt_scope(w, w, w)); static_assert(utx::in_scope(w, w, w)); }
Last revised: June 13, 2022 at 03:08:21 GMT |