MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / flat

Method flat

docopt_private.h:162–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160 }
161
162 virtual std::vector<Pattern*> flat(bool (*filter)(Pattern const*)) override {
163 if (filter(this)) {
164 return {this};
165 }
166
167 std::vector<Pattern*> ret;
168 for(auto& child : fChildren) {
169 auto sublist = child->flat(filter);
170 ret.insert(ret.end(), sublist.begin(), sublist.end());
171 }
172 return ret;
173 }
174
175 virtual void collect_leaves(std::vector<LeafPattern*>& lst) override final {
176 for(auto& child : fChildren) {

Callers

nothing calls this directly

Calls 1

flatMethod · 0.45

Tested by

no test coverage detected