summaryrefslogtreecommitdiff
path: root/AK/NonnullPtrVector.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-25 11:10:28 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-25 11:10:28 +0200
commit6a5446d6ddf009e5fe4970e8509e2b669222a7df (patch)
tree2b15ae191222ca67c82e9aca3e3a2ff5fd27ab72 /AK/NonnullPtrVector.h
parent10d120dc852fce62eb11ec5ec80f68374ef01501 (diff)
downloadserenity-6a5446d6ddf009e5fe4970e8509e2b669222a7df.zip
AK: Simplify NonnullPtrVector template a bit.
Add an "ElementType" typedef to NonnullOwnPtr and NonnullRefPtr to allow clients to easily find the pointee type. Then use this to remove a template argument from NonnullPtrVector. :^)
Diffstat (limited to 'AK/NonnullPtrVector.h')
-rw-r--r--AK/NonnullPtrVector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/NonnullPtrVector.h b/AK/NonnullPtrVector.h
index 345da11e08..2cc7147c4a 100644
--- a/AK/NonnullPtrVector.h
+++ b/AK/NonnullPtrVector.h
@@ -4,8 +4,9 @@
namespace AK {
-template<typename PtrType, typename T, int inline_capacity = 0>
+template<typename PtrType, int inline_capacity = 0>
class NonnullPtrVector : public Vector<PtrType, inline_capacity> {
+ typedef typename PtrType::ElementType T;
typedef Vector<PtrType, inline_capacity> Base;
public: