OGLplus  (0.59.0) a C++ wrapper for rendering APIs

less_than.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_VALID_IF_LESS_THAN_HPP
10 #define EAGINE_VALID_IF_LESS_THAN_HPP
11 
12 #include "decl.hpp"
13 
14 namespace eagine {
15 
18 template <typename T, T Cmp>
20 
22  constexpr auto operator()(T value) const noexcept {
23  return value < Cmp;
24  }
25 
26  struct do_log {
27  template <typename X, typename = disable_if_same_t<X, do_log>>
28  constexpr do_log(X&&) noexcept {}
29 
30  template <typename Log>
31  void operator()(Log& log, const T& v) const {
32  log << "Value " << v << ", "
33  << "greater then or equal to " << Cmp << " "
34  << "is invalid";
35  }
36  };
37 };
38 
43 template <typename T, T Cmp>
45 
46 } // namespace eagine
47 
48 #endif // EAGINE_VALID_IF_LESS_THAN_HPP
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 < Cmp.
Definition: less_than.hpp:22
Policy class for values valid if less than Cmp.
Definition: less_than.hpp:19

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).