From 6d6047f7425657ce0d7155574dcf95cfa3174937 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Sun, 17 Nov 2019 17:31:40 +0800 Subject: [PATCH] fix compilation errors for vs2015 --- src/memory/allocator_wrapper.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/memory/allocator_wrapper.h b/src/memory/allocator_wrapper.h index 8b066ba..f499fd0 100755 --- a/src/memory/allocator_wrapper.h +++ b/src/memory/allocator_wrapper.h @@ -51,20 +51,16 @@ private: public: allocator_wrapper() noexcept {} - // no copy - allocator_wrapper(const allocator_wrapper&) noexcept {} - template - allocator_wrapper(const allocator_wrapper&) noexcept {} + // construct by copying (do nothing) + allocator_wrapper (const allocator_wrapper&) noexcept {} + allocator_wrapper& operator=(const allocator_wrapper&) noexcept { return *this; } + + // construct from a related allocator (do nothing) + template allocator_wrapper (const allocator_wrapper&) noexcept {} + template allocator_wrapper& operator=(const allocator_wrapper&) noexcept { return *this; } - allocator_wrapper(allocator_wrapper && rhs) noexcept : alloc_(std::move(rhs.alloc_)) {} - template - allocator_wrapper(allocator_wrapper && rhs) noexcept : alloc_(std::move(rhs.alloc_)) {} - allocator_wrapper(alloc_policy && rhs) noexcept : alloc_(std::move(rhs)) {} - - allocator_wrapper& operator=(allocator_wrapper && rhs) noexcept { - alloc_ = std::move(rhs.alloc_); - return *this; - } + allocator_wrapper (allocator_wrapper && rhs) noexcept : alloc_ { std::move(rhs.alloc_) } {} + allocator_wrapper& operator=(allocator_wrapper && rhs) noexcept { alloc_ = std::move(rhs.alloc_); return *this; } public: // the other type of std_allocator