diff options
author | Jack Lloyd <[email protected]> | 2016-10-13 14:42:29 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-13 14:42:29 -0400 |
commit | 9f7b4486e1015886638168f49673398bee7a71bf (patch) | |
tree | c82efa8b12765cc5a793758ac6ea39e9d559197b /src/lib | |
parent | 30c85ac981fdad46639ce02aa7e8612601fc5245 (diff) | |
parent | d137c28ccc212067e43bfe17ac8328bec0f944fe (diff) |
Merge GH #646 Fix MSVC debug configurations. Add debug builds to AppVeyor
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/base/secmem.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/base/secmem.h b/src/lib/base/secmem.h index ff76e9429..a99132507 100644 --- a/src/lib/base/secmem.h +++ b/src/lib/base/secmem.h @@ -24,7 +24,16 @@ template<typename T> class secure_allocator { public: + /* + * Assert exists to prevent someone from doing something that will + * probably crash anyway (like secure_vector<non_POD_t> where ~non_POD_t + * deletes a member pointer which was zeroed before it ran). + * MSVC in debug mode uses non-integral proxy types in container types + * like std::vector, thus we disable the check there. + */ +#if !defined(_ITERATOR_DEBUG_LEVEL) || _ITERATOR_DEBUG_LEVEL == 0 static_assert(std::is_integral<T>::value, "secure_allocator supports only integer types"); +#endif typedef T value_type; |