23#ifndef TCLAP_COMPARISON_CONSTRAINT_H
24#define TCLAP_COMPARISON_CONSTRAINT_H
36template <
class T,
class Compare>
40 const std::string &symbol)
41 : _bound(bound), _relation(relation), _shortId() {
42 std::ostringstream out;
43 out <<
'[' << symbol << _bound <<
']';
47 bool operator()(
const T &value)
const {
return Compare()(value, _bound); }
49 std::ostringstream out;
50 out <<
"value must be " << _relation <<
' ' << _bound;
53 std::string
shortID()
const {
return _shortId; }
57 std::string _relation;
61template <
class T,
class Compare>
67 const std::string &symbol)
89 bound,
"less than",
"<") {}
99 bound,
"less than or equal to",
"<=") {}
109 bound,
"greater than",
">") {}
119 bound,
"greater than or equal to",
">=") {}
Accepts values strictly greater than an owned lower bound.
GreaterThanConstraint(const T &bound)
Accepts values greater than or equal to an owned lower bound.
GreaterThanOrEqualConstraint(const T &bound)
Accepts values strictly less than an owned upper bound.
LessThanConstraint(const T &bound)
Accepts values less than or equal to an owned upper bound.
LessThanOrEqualConstraint(const T &bound)
Adapts an owned function or const function object to Constraint<T>.
ComparisonConstraintBase(const T &bound, const std::string &relation, const std::string &symbol)
bool operator()(const T &value) const
std::string shortID() const
std::string description() const
ComparisonRule(const T &bound, const std::string &relation, const std::string &symbol)