Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef CAN_NEW_ARRAY_H
00009 #define CAN_NEW_ARRAY_H
00010
00014 #include <cstddef>
00015 #include "canArray.h"
00016
00017 namespace can {
00018
00026 template <class T>
00027 class NewArray : public Array<T,0>
00028 {
00029 public:
00031 NewArray() {}
00033 NewArray(std::size_t n) : Array<T,0>(n) {}
00035 ~NewArray() {}
00037 bool allocated() const {return this->elems;}
00039 void deallocate()
00040 {
00041 delete [] this->elems;
00042 this->sz = 0;
00043 this->elems=0;
00044 }
00048 void allocate(std::size_t n) {this->resize(n);}
00049 private:
00050 NewArray(NewArray<T> const& other);
00051 NewArray<T>& operator=(const NewArray<T>& other);
00052 };
00053
00054 }
00055
00056 #endif