Add an "at" function to ParseTree

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-02-06 19:50:37 +01:00
parent 1a37e35228
commit a45902c9b2
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -77,6 +77,7 @@ public:
return optional<reference_wrapper<T>>();
};
inline component_ptr& operator[](const unsigned int& index) const { return subComponents[index]; }
inline component_ptr& at(const unsigned int& index) const { return subComponents.at(index); }
IS(NamedIdentifier)
inline auto operator[](const string& key) const { return findReferenceByName<T>(key); }
IS_PARSECOMPONENT inline void add(const T& component) { addComponent<T>(component); }