diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index 6ed1f10..8e9938c 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -59,21 +59,21 @@ public: inline iterator end() const noexcept { return subComponents.end(); } inline const_iterator cend() const noexcept { return subComponents.cend(); } IS_PARSECOMPONENT - auto findById() const { - return subComponents | filter([](unique_ptr& it) -> bool { - return it->getId() == typeid(T); - }) | transform([](unique_ptr& it) { - return reinterpret_cast(it.get()); + vector findById() const { + vector filteredComponents; + for_each(cbegin(), cend(), [&filteredComponents](const unique_ptr& it) { + if (it->getId() == typeid(T)) { + filteredComponents.push_back(reinterpret_cast(it.get())); + } }); + return filteredComponents; } IS(StandardComponents::NamedIdentifier) optional> findReferenceByName(const string& name) const { - auto identifiers = findById() | transform([](T* it) { - return ref(static_cast(*it)); - }); + auto identifiers = findById(); for (const auto& identifier: identifiers) { - if (identifier.get().getId() == typeid(T) && identifier.get().name == name) { - return make_optional(identifier); + if (identifier->getId() == typeid(T) && identifier->name == name) { + return make_optional(ref(static_cast(*identifier))); } } return optional>();