Go to the documentation of this file.
9 #ifndef EAGINE_VALID_IF_IN_LIST_HPP
10 #define EAGINE_VALID_IF_IN_LIST_HPP
18 template <
typename T,
typename Range>
23 : _choices(choices) {}
27 for(
const T& choice : _choices) {
28 if(are_equal(value, choice)) {
39 : _choices(p._choices) {}
41 template <
typename Log>
43 log <<
"Value '" << v <<
"', "
44 <<
"other than one of the values [";
47 for(
const T& choice : _choices) {
48 log << (first ?
"" :
", ") <<
"'" << choice <<
"'";
51 log <<
"] is invalid";
58 template <
typename T,
typename Range>
63 #endif // EAGINE_VALID_IF_IN_LIST_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
Primary template for conditionally valid values.
Definition: decl.hpp:49
auto operator()(const T &value) const noexcept -> bool
Indicates value validity, true if value is one of the specified choices.
Definition: in_list.hpp:26
Policy for values valid if contained in object of Range type.
Definition: in_list.hpp:19