diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2004-06-19 08:28:09 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2004-06-19 08:28:09 +0000 |
commit | 5283f5059b14d63ed0ed54c8384890320fbb9ec6 (patch) | |
tree | 187e9abc73ba1918391e24a30eb0b9638f12941e /secblock.h | |
parent | accbb9d893ba34323919f5e17db17e6833d96f50 (diff) | |
download | cryptopp-5283f5059b14d63ed0ed54c8384890320fbb9ec6.tar.gz |
port to GCC 3.4
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@168 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'secblock.h')
-rw-r--r-- | secblock.h | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -197,7 +197,7 @@ template <class T, class A = AllocatorWithCleanup<T> > class SecBlock { public: - explicit SecBlock(unsigned int size=0) + explicit SecBlock(unsigned int size=0) : m_size(size) {m_ptr = m_alloc.allocate(size, NULL);} SecBlock(const SecBlock<T, A> &t) : m_size(t.m_size) {m_ptr = m_alloc.allocate(m_size, NULL); memcpy(m_ptr, t.m_ptr, m_size*sizeof(T));} @@ -214,25 +214,15 @@ public: ~SecBlock() {m_alloc.deallocate(m_ptr, m_size);} -#if defined(__GNUC__) || defined(__BCPLUSPLUS__) operator const void *() const {return m_ptr;} operator void *() {return m_ptr;} -#endif -#if defined(__GNUC__) // reduce warnings - operator const void *() - {return m_ptr;} -#endif operator const T *() const {return m_ptr;} operator T *() {return m_ptr;} -#if defined(__GNUC__) // reduce warnings - operator const T *() - {return m_ptr;} -#endif template <typename I> T *operator +(I offset) @@ -250,6 +240,7 @@ public: const T& operator[](I index) const {assert(index >= 0 && (unsigned int)index < m_size); return m_ptr[index];} + typedef typename A::value_type value_type; typedef typename A::pointer iterator; typedef typename A::const_pointer const_iterator; typedef typename A::size_type size_type; |