1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:57:35 +00:00

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. :^)
This commit is contained in:
Andreas Kling 2019-07-25 11:10:28 +02:00
parent 10d120dc85
commit 6a5446d6dd
5 changed files with 9 additions and 6 deletions

View file

@ -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: