From 7677f329b5f8b4976d2c858c31a6e48d31d2db9c Mon Sep 17 00:00:00 2001 From: bogdan Date: Wed, 5 Aug 2015 18:09:01 +0300 Subject: Add template constructor to secure_allocator This is required by the Standard for an allocator. As far as I can tell, not having it breaks compilation in MSVC 2015, at least when iterator debugging is enabled. More details here: http://stackoverflow.com/q/31802806/4326278. --- src/lib/alloc/secmem.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/lib/alloc/secmem.h b/src/lib/alloc/secmem.h index 98707ad4e..453acc5d8 100644 --- a/src/lib/alloc/secmem.h +++ b/src/lib/alloc/secmem.h @@ -36,6 +36,9 @@ class secure_allocator secure_allocator() BOTAN_NOEXCEPT {} + template + secure_allocator(const secure_allocator&) BOTAN_NOEXCEPT {} + ~secure_allocator() BOTAN_NOEXCEPT {} pointer address(reference x) const BOTAN_NOEXCEPT -- cgit v1.2.3 From 937426a903c2199fb677082f92038b14dc0b519e Mon Sep 17 00:00:00 2001 From: bogdan Date: Sat, 29 Aug 2015 01:15:12 +0300 Subject: Make the equality operators standard-compliant. The equality operators need to support different specializations as well; this is also part of the standard allocator requirements. --- src/lib/alloc/secmem.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/alloc/secmem.h b/src/lib/alloc/secmem.h index 453acc5d8..63d4e5296 100644 --- a/src/lib/alloc/secmem.h +++ b/src/lib/alloc/secmem.h @@ -85,12 +85,12 @@ class secure_allocator template void destroy(U* p) { p->~U(); } }; -template inline bool -operator==(const secure_allocator&, const secure_allocator&) +template inline bool +operator==(const secure_allocator&, const secure_allocator&) { return true; } -template inline bool -operator!=(const secure_allocator&, const secure_allocator&) +template inline bool +operator!=(const secure_allocator&, const secure_allocator&) { return false; } template using secure_vector = std::vector>; -- cgit v1.2.3