AutoDeleter: add operator [] for ArrayDeleter

Change-Id: I015951053050b58e73fd71e4abb104a0755416f7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2890
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
This commit is contained in:
X512 2020-06-07 17:09:56 +09:00 committed by Axel Dörfler
parent 638f8647a6
commit 8301c4980b

View File

@ -122,6 +122,11 @@ struct ArrayDeleter : AutoDeleter<C, ArrayDelete<C> >
{
ArrayDeleter() : AutoDeleter<C, ArrayDelete<C> >() {}
ArrayDeleter(C *array) : AutoDeleter<C, ArrayDelete<C> >(array) {}
inline C& operator[](size_t index) const
{
return this->Get()[index];
}
};