From 0fa6af3cd57f578e34fe6c87b9e92af3dd74732f Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 4 Mar 2015 18:26:11 -0500 Subject: [PATCH] Added additional 'map' functions. --- peglib.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/peglib.h b/peglib.h index fd46d52..1d99766 100644 --- a/peglib.h +++ b/peglib.h @@ -248,6 +248,16 @@ struct SemanticValues : protected std::vector } return r; } + + template + auto map() const -> vector { + return this->map([](const SemanticValue& v) { return v.get(); }); + } + + template + auto map(It beg, It end) const -> vector { + return this->map(beg, end, [](const SemanticValue& v) { return v.get(); }); + } }; /*