From d40f03e4090edafea75f04a1697ef0384231d333 Mon Sep 17 00:00:00 2001 From: guyingzhao Date: Fri, 28 Feb 2025 00:17:57 +0800 Subject: C++: Add more convenience functions to the interface --- include/plist/Array.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/plist/Array.h') diff --git a/include/plist/Array.h b/include/plist/Array.h index 0239c78..34ddd6f 100644 --- a/include/plist/Array.h +++ b/include/plist/Array.h @@ -57,6 +57,16 @@ public : void Remove(Node* node); void Remove(unsigned int pos); unsigned int GetNodeIndex(Node* node) const; + template + T* at(unsigned int index) + { + return (T*)(_array.at(index)); + } + template + T* At(unsigned int index) + { + return (T*)(_array.at(index)); + } private : std::vector _array; -- cgit v1.1-32-gdbae