16 static constexpr
char s_rangeSeparator =
':';
25 interval.
lower.reset();
26 interval.
upper.reset();
29 auto pos = buf.find_first_of(s_rangeSeparator);
31 if (
pos == std::string::npos) {
37 auto lowerStr = buf.substr(0,
pos);
38 interval.
lower = std::atof(lowerStr.c_str());
41 if ((
pos + 1) < buf.size()) {
42 auto upperStr = buf.substr(
pos + 1);
43 interval.
upper = std::atof(upperStr.c_str());
51 if (not interval.
lower.has_value() and not interval.
upper.has_value()) {
54 if (interval.
lower.has_value()) {
55 os << interval.
lower.value();
57 os << s_rangeSeparator;
58 if (interval.
upper.has_value()) {
59 os << interval.
upper.value();
66 std::istream& is, std::vector<ActsExamples::Options::Interval>& intervals) {
67 for (
auto& interval : intervals) {
75 const std::vector<ActsExamples::Options::Interval>& intervals) {
76 for (
auto& interval : intervals) {
84 template <
typename Iterator>
85 inline std::ostream& printContainer(std::ostream& os, Iterator begin,
87 for (
auto it = begin;
it != end; ++
it) {
98 return printContainer(os, vec.begin(), vec.end(),
" ");
102 return printContainer(os, vec.begin(), vec.end(),
" ");
106 return printContainer(os, vec.begin(), vec.end(),
" ");