From 7d4256587393ca6714368f54091cbc7f4deddd61 Mon Sep 17 00:00:00 2001 From: "Taylor C. Richberger" Date: Thu, 7 Jul 2016 16:33:37 -0600 Subject: switch pages to a submodule --- args.hxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'args.hxx') diff --git a/args.hxx b/args.hxx index 39fbdea..f2a45b9 100644 --- a/args.hxx +++ b/args.hxx @@ -585,7 +585,9 @@ namespace args std::function validator; public: + /// If help is empty, this group will not be printed in help output Group(const std::string &help = std::string(), const std::function &validator = Validators::DontCare) : Base(help), validator(validator) {} + /// If help is empty, this group will not be printed in help output Group(Group &group, const std::string &help = std::string(), const std::function &validator = Validators::DontCare) : Base(help), validator(validator) { group.Add(*this); @@ -673,7 +675,7 @@ namespace args /** Get all this group's children */ - const std::vector Children() const + const std::vector &Children() const { return children; } @@ -813,17 +815,9 @@ namespace args static bool AllChildGroups(const Group &group) { - for (const auto child: group.Children()) - { - if (const auto group = dynamic_cast(child)) - { - if (!group->Matched()) - { - return false; - } - } - } - return true; + return std::find_if(std::begin(group.Children()), std::end(group.Children()), [](const Base* child) -> bool { + return dynamic_cast(child) && !child->Matched(); + }) == std::end(group.Children()); } static bool DontCare(const Group &group) -- cgit v1.2.1