diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index ef81f7d..f8ceedb 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -52,10 +52,11 @@ protected: public: IS(StandardComponents::NamedIdentifier) optional> findByName(const string& name) { - auto identifiers = findById(); - for (const auto& identifier: identifiers) { - if (identifier.name == name) { - return identifier; + auto identifiers = findById(); + for (auto&& identifier: identifiers) { + if (identifier.getId() == typeid(T) && identifier.name == name) { + return make_optional(reference_wrapper(identifier)); + break; } } return optional>();