acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
ptr_array.h
1#pragma once
2
3
4#include "array_base.h"
5#include "acme/prototype/prototype/ptr.h"
6#include "comparable_eq_array.h"
7#include "comparable_array.h"
8#include "pointer_array_process.h"
9
10
11template < class T >
12class ptr_array :
13 public pointer_array_process < comparable_array < ::ptr < T >, const T * >, T >
14{
15public:
16
17 using BASE_ARRAY = pointer_array_process < comparable_array < ::ptr < T >, const T * > , T >;
18
19
20 ptr_array() { }
21 ptr_array(const ptr_array& array) : BASE_ARRAY(array) { }
22 ptr_array(ptr_array && array) : BASE_ARRAY(::transfer(array)) { }
23
24
25 T & object_at(::collection::index i) { return *this->element_at(i); }
26 const T & object_at(::collection::index i) const { return *this->element_at(i); }
27
28
29 ptr_array & operator=(const ptr_array & ptra) { BASE_ARRAY::operator=(ptra); return *this; }
30 ptr_array & operator=(ptr_array && ptra) { BASE_ARRAY::operator=(::transfer(ptra)); return *this; }
31
32
33};
34
35
36
37