diff options
author | Matt Cotter <matt.cotter@mongodb.com> | 2016-12-13 16:11:41 -0500 |
---|---|---|
committer | Matt Cotter <matt.cotter@mongodb.com> | 2016-12-15 17:07:30 -0500 |
commit | d6a23485995c3351a8c797bc4d74a55edbbce8fe (patch) | |
tree | 5275892b161e12705b7717b35f8670fae47cb316 /src/mongo/base | |
parent | 39bcdc6e6ef4980d6103ca0746ef1f4347aae841 (diff) | |
download | mongo-d6a23485995c3351a8c797bc4d74a55edbbce8fe.tar.gz |
SERVER-26698 switch all compiles to C++14
Enjoy the C++14! 😀 ❤️ thank you!
Diffstat (limited to 'src/mongo/base')
-rw-r--r-- | src/mongo/base/secure_allocator.cpp | 2 | ||||
-rw-r--r-- | src/mongo/base/secure_allocator.h | 24 |
2 files changed, 12 insertions, 14 deletions
diff --git a/src/mongo/base/secure_allocator.cpp b/src/mongo/base/secure_allocator.cpp index 8c551ad94ec..982b24a12ef 100644 --- a/src/mongo/base/secure_allocator.cpp +++ b/src/mongo/base/secure_allocator.cpp @@ -302,7 +302,7 @@ public: * Returns null if the request can't be satisifed. */ void* allocate(std::size_t size, std::size_t alignOf) { - if (stdx::align(alignOf, size, _ptr, _remaining)) { + if (std::align(alignOf, size, _ptr, _remaining)) { auto result = _ptr; _ptr = static_cast<char*>(_ptr) + size; _remaining -= size; 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. |