summaryrefslogtreecommitdiff
path: root/secblock.h
diff options
context:
space:
mode:
Diffstat (limited to 'secblock.h')
-rw-r--r--secblock.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/secblock.h b/secblock.h
index e07c6a2..580aab7 100644
--- a/secblock.h
+++ b/secblock.h
@@ -18,7 +18,7 @@ class AllocatorBase
public:
typedef T value_type;
typedef size_t size_type;
-#if (defined(_MSC_VER) && _MSC_VER < 1300)
+#ifdef CRYPTOPP_MSVCRT6
typedef ptrdiff_t difference_type;
#else
typedef std::ptrdiff_t difference_type;
@@ -94,6 +94,10 @@ public:
template <class U> struct rebind { typedef AllocatorWithCleanup<U> other; };
};
+CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<byte>;
+CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word16>;
+CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word32>;
+
template <class T>
class NullAllocator : public AllocatorBase<T>
{
@@ -325,7 +329,12 @@ public:
m_size = newSize;
}
- void swap(SecBlock<T, A> &b);
+ void swap(SecBlock<T, A> &b)
+ {
+ std::swap(m_alloc, b.m_alloc);
+ std::swap(m_size, b.m_size);
+ std::swap(m_ptr, b.m_ptr);
+ }
//private:
A m_alloc;
@@ -333,13 +342,6 @@ public:
T *m_ptr;
};
-template <class T, class A> void SecBlock<T, A>::swap(SecBlock<T, A> &b)
-{
- std::swap(m_alloc, b.m_alloc);
- std::swap(m_size, b.m_size);
- std::swap(m_ptr, b.m_ptr);
-}
-
typedef SecBlock<byte> SecByteBlock;
typedef SecBlock<word> SecWordBlock;