ParseComponents.hpp: Add two helper functions for ParseTree.parent
Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
a3e2427017
commit
bd87e9a93b
|
@ -74,6 +74,11 @@ public:
|
||||||
inline constant_iterator cend() const noexcept { return subComponents.cend(); }
|
inline constant_iterator cend() const noexcept { return subComponents.cend(); }
|
||||||
|
|
||||||
const decltype(parent)& getParent() const { return parent; }
|
const decltype(parent)& getParent() const { return parent; }
|
||||||
|
void traverse_parent(const auto& lambda) const
|
||||||
|
{ if (parent.has_value()) for_each(parent.value().get().begin(), parent.value().get().end(), lambda); }
|
||||||
|
bool any_parent(const auto& lambda) const
|
||||||
|
{ return parent.has_value() and any_of(parent.value().get().begin(), parent.value().get().end(), lambda); }
|
||||||
|
|
||||||
|
|
||||||
IS_PARSECOMPONENT
|
IS_PARSECOMPONENT
|
||||||
vector<T*> findById() const {
|
vector<T*> findById() const {
|
||||||
|
|
Loading…
Reference in New Issue