diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-25 11:10:28 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-25 11:10:28 +0200 |
commit | 6a5446d6ddf009e5fe4970e8509e2b669222a7df (patch) | |
tree | 2b15ae191222ca67c82e9aca3e3a2ff5fd27ab72 /AK/NonnullPtrVector.h | |
parent | 10d120dc852fce62eb11ec5ec80f68374ef01501 (diff) | |
download | serenity-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.h | 3 |
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: |