mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-01-22 21:35:29 +00:00
Added additional 'map' functions.
This commit is contained in:
parent
fb42532c7c
commit
0fa6af3cd5
10
peglib.h
10
peglib.h
@ -248,6 +248,16 @@ struct SemanticValues : protected std::vector<SemanticValue>
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
auto map() const -> vector<T> {
|
||||||
|
return this->map([](const SemanticValue& v) { return v.get<T>(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, typename It>
|
||||||
|
auto map(It beg, It end) const -> vector<T> {
|
||||||
|
return this->map(beg, end, [](const SemanticValue& v) { return v.get<T>(); });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user