diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index e204435..f191182 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -25,9 +25,11 @@ struct NamedIdentifier: ParseComponent { explicit NamedIdentifier(string_view nameText): name(nameText) {} }; +typedef unique_ptr component_ptr; + #define IS_PARSECOMPONENT IS(ParseComponent) class ParseTree: public ParseComponent { - mutable vector> subComponents; + mutable vector subComponents; using array_type = decltype(subComponents); using iterator = array_type::iterator; using constant_iterator = array_type::const_iterator; @@ -57,7 +59,7 @@ public: IS_PARSECOMPONENT vector findById() const { vector filteredComponents; - for_each(cbegin(), cend(), [&filteredComponents](const unique_ptr& it) { + for_each(cbegin(), cend(), [&filteredComponents](const component_ptr& it) { if (it->getId() == typeid(T)) { filteredComponents.push_back(reinterpret_cast(it.get())); } @@ -74,7 +76,7 @@ public: } return optional>(); }; - inline decltype(*subComponents.data()) operator[](const unsigned int& index) const { return subComponents[index]; } + inline component_ptr& operator[](const unsigned int& index) const { return subComponents[index]; } IS(NamedIdentifier) inline auto operator[](const string& key) const { return findReferenceByName(key); } IS_PARSECOMPONENT inline void add(const T& component) { addComponent(component); } diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index 4ea5b9e..bc39d17 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -109,7 +109,7 @@ public: } output.str(string()); for (unsigned int i = 0; i < tree.size(); ++i) { - const unique_ptr& component = tree[i]; + const component_ptr& component = tree[i]; const type_info& id = component->getId(); try { taskMap.at(id)(tree, i);