OGLplus
(0.59.0)
a C++ wrapper for rendering APIs
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
Functions
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
Variables
Typedefs
a
b
c
d
e
g
h
i
k
l
m
n
o
p
r
s
t
u
v
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
Related Functions
o
Files
File List
File Members
All
Macros
Examples
eagine
valid_if
between.hpp
Go to the documentation of this file.
1
9
#ifndef EAGINE_VALID_IF_BETWEEN_HPP
10
#define EAGINE_VALID_IF_BETWEEN_HPP
11
12
#include "
decl.hpp
"
13
14
namespace
eagine
{
15
22
template
<
typename
T,
typename
C, C Min, C Max>
23
struct
valid_if_btwn_policy
{
24
26
constexpr
auto
operator()
(T value)
const
noexcept {
27
return
(T(Min) <= value) && (value <= T(Max));
28
}
29
30
struct
do_log {
31
template
<
typename
X,
typename
= disable_if_same_t<X, do_log>>
32
constexpr do_log(X&&) noexcept {}
33
34
template
<
typename
Log>
35
void
operator()
(Log& log,
const
T& v)
const
{
36
log <<
"Value "
<< v <<
", not between "
<< Min <<
" and "
<< Max
37
<<
" is invalid"
;
38
}
39
};
40
};
41
44
template
<
typename
T,
typename
C, C Min, C Max>
45
using
valid_if_between_c
=
valid_if<T, valid_if_btwn_policy<T, C, Min, Max>
>;
46
52
template
<
typename
T, T Min, T Max>
53
using
valid_if_between
=
valid_if_between_c<T, T, Min, Max>
;
54
55
}
// namespace eagine
56
57
#endif // EAGINE_VALID_IF_BETWEEN_HPP
eagine::valid_if_btwn_policy::operator()
constexpr auto operator()(T value) const noexcept
Indicates value validity, true if between Min and Max.
Definition:
between.hpp:26
eagine
Common code is placed in this namespace.
Definition:
eagine.hpp:21
eagine::valid_if
Primary template for conditionally valid values.
Definition:
decl.hpp:49
eagine::valid_if_btwn_policy
Policy for values valid if between Min and Max.
Definition:
between.hpp:23
decl.hpp
Copyright © 2015-2021
Matúš Chochlík
.
<
chochlik -at -gmail.com
>
Documentation generated on Tue Apr 13 2021 by
Doxygen
(version 1.8.17).