瀏覽代碼

alignment: Resolve allocator construction issues on debug

This was related to the source allocator being passed into the
constructor potentially having a different type than allocator being
constructed.

We simply need to provide a constructor to handle this case.

This resolves issues related to the allocator causing debug builds on
MSVC to fail.
Lioncash 6 年之前
父節點
當前提交
57ffada746
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/common/alignment.h

+ 5 - 0
src/common/alignment.h

@@ -57,6 +57,11 @@ public:
     using is_always_equal = std::true_type;
 
 public:
+    constexpr AlignmentAllocator() noexcept = default;
+
+    template <typename T2>
+    constexpr AlignmentAllocator(const AlignmentAllocator<T2, Align>&) noexcept {}
+
     pointer address(reference r) noexcept {
         return std::addressof(r);
     }