Fix the findByName function.
This commit is contained in:
parent
fa546865a0
commit
dd223026a0
|
@ -52,10 +52,11 @@ protected:
|
||||||
public:
|
public:
|
||||||
IS(StandardComponents::NamedIdentifier)
|
IS(StandardComponents::NamedIdentifier)
|
||||||
optional<reference_wrapper<T>> findByName(const string& name) {
|
optional<reference_wrapper<T>> findByName(const string& name) {
|
||||||
auto identifiers = findById<StandardComponents::NamedIdentifier>();
|
auto identifiers = findById<T>();
|
||||||
for (const auto& identifier: identifiers) {
|
for (auto&& identifier: identifiers) {
|
||||||
if (identifier.name == name) {
|
if (identifier.getId() == typeid(T) && identifier.name == name) {
|
||||||
return identifier;
|
return make_optional(reference_wrapper<T>(identifier));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return optional<reference_wrapper<T>>();
|
return optional<reference_wrapper<T>>();
|
||||||
|
|
Loading…
Reference in New Issue