41#ifndef Foam_scalarRanges_H
42#define Foam_scalarRanges_H
58 public List<scalarRange>
72 explicit
scalarRanges(const std::
string& str,
bool report = true)
89 bool contains(
const scalar value)
const
93 if (
range.contains(value))
102 bool match(
const scalar value)
const {
return contains(value); }
Scalar bounds to be used as a unary predicate.
A collection of scalar bounds to be used as a unary predicate.
constexpr scalarRanges() noexcept=default
Default construct.
bool operator()(const scalar value) const
For use as a predicate, same as contains().
bool contains(const scalar value) const
True if the value is contained by any of the sub-ranges.
static scalarRanges parse(const std::string &str, bool report=true)
Construct by parsing string for scalar ranges with optional reporting if any range fails to parse.
bool match(const scalar value) const
True if the value is matched by any of the sub-ranges.