summaryrefslogtreecommitdiff
path: root/src/mongo/base/secure_allocator.h
diff options
context:
space:
mode:
authorMatt Cotter <matt.cotter@mongodb.com>2016-12-13 16:11:41 -0500
committerMatt Cotter <matt.cotter@mongodb.com>2016-12-15 17:07:30 -0500
commitd6a23485995c3351a8c797bc4d74a55edbbce8fe (patch)
tree5275892b161e12705b7717b35f8670fae47cb316 /src/mongo/base/secure_allocator.h
parent39bcdc6e6ef4980d6103ca0746ef1f4347aae841 (diff)
downloadmongo-d6a23485995c3351a8c797bc4d74a55edbbce8fe.tar.gz
SERVER-26698 switch all compiles to C++14
Enjoy the C++14! 😀 ❤️ thank you!
Diffstat (limited to 'src/mongo/base/secure_allocator.h')
-rw-r--r--src/mongo/base/secure_allocator.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/mongo/base/secure_allocator.h b/src/mongo/base/secure_allocator.h
index b22ccf771a5..a642b47abb8 100644
--- a/src/mongo/base/secure_allocator.h
+++ b/src/mongo/base/secure_allocator.h
@@ -72,21 +72,19 @@ void deallocate(void* ptr, std::size_t bytes);
*/
template <typename T>
struct SecureAllocator {
-/**
- * We only support trivially copyable types to avoid situations where the
- * SecureAllocator is used in containers with complex types that do their
- * own allocation. I.e. one could otherwise have a:
- *
- * std::vector<std::string, SecureAllocator<std::string>>
- *
- * where the vectors were stored securely, but the strings spilled to the
- * heap
- *
- */
-#ifdef MONGO_CONFIG_HAVE_STD_IS_TRIVIALLY_COPYABLE
+ /**
+ * We only support trivially copyable types to avoid situations where the
+ * SecureAllocator is used in containers with complex types that do their
+ * own allocation. I.e. one could otherwise have a:
+ *
+ * std::vector<std::string, SecureAllocator<std::string>>
+ *
+ * where the vectors were stored securely, but the strings spilled to the
+ * heap
+ *
+ */
MONGO_STATIC_ASSERT_MSG(std::is_trivially_copyable<T>::value,
"SecureAllocator can only be used with trivially copyable types");
-#endif
// NOTE: The standard doesn't seem to require these, but libstdc++
// definitly wants them.