diff options
author | weidai <weidai11@users.noreply.github.com> | 2007-05-04 15:24:09 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2007-05-04 15:24:09 +0000 |
commit | d2510f30c75b341dcbc45432a4bd38c0513f2616 (patch) | |
tree | 3ddcd92ac078642dfed5375980dc2db4006d1498 /smartptr.h | |
parent | 460c2d6c6adc5490c77777f8f8b2e96cc4bf4eb3 (diff) | |
download | cryptopp-git-d2510f30c75b341dcbc45432a4bd38c0513f2616.tar.gz |
fix compile for x64, DLL and VC 6
Diffstat (limited to 'smartptr.h')
-rw-r--r-- | smartptr.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -189,21 +189,21 @@ template <class T> counted_ptr<T> & counted_ptr<T>::operator=(const counted_ptr< template <class T> class vector_member_ptrs { public: - vector_member_ptrs(unsigned int size=0) + vector_member_ptrs(size_t size=0) : m_size(size), m_ptr(new member_ptr<T>[size]) {} ~vector_member_ptrs() {delete [] this->m_ptr;} - member_ptr<T>& operator[](unsigned int index) + member_ptr<T>& operator[](size_t index) {assert(index<this->m_size); return this->m_ptr[index];} - const member_ptr<T>& operator[](unsigned int index) const + const member_ptr<T>& operator[](size_t index) const {assert(index<this->m_size); return this->m_ptr[index];} - unsigned int size() const {return this->m_size;} - void resize(unsigned int newSize) + size_t size() const {return this->m_size;} + void resize(size_t newSize) { member_ptr<T> *newPtr = new member_ptr<T>[newSize]; - for (unsigned int i=0; i<this->m_size && i<newSize; i++) + for (size_t i=0; i<this->m_size && i<newSize; i++) newPtr[i].reset(this->m_ptr[i].release()); delete [] this->m_ptr; this->m_size = newSize; @@ -214,7 +214,7 @@ private: vector_member_ptrs(const vector_member_ptrs<T> &c); // copy not allowed void operator=(const vector_member_ptrs<T> &x); // assignment not allowed - unsigned int m_size; + size_t m_size; member_ptr<T> *m_ptr; }; |