Fix compilation for Linux

This commit is contained in:
Wojtek Figat
2021-05-14 09:31:10 +02:00
parent fd3553f668
commit 8dc9834f48
2 changed files with 3 additions and 7 deletions

View File

@@ -42,7 +42,7 @@
#include "TargetConditionals.h"
#endif
#include <atomic> // Requires C++11. Sorry VS2010.
#include <atomic>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
@@ -156,11 +156,7 @@ namespace details {
: static_cast<T>(-1);
};
#if defined(__GLIBCXX__)
typedef ::max_align_t std_max_align_t; // libstdc++ forgot to add it to std:: for a while
#else
typedef std::max_align_t std_max_align_t; // Others (e.g. MSVC) insist it can *only* be accessed via std::
#endif
typedef std::max_align_t std_max_align_t;
// Some platforms have incorrectly set max_align_t to a type with <8 bytes alignment even while supporting
// 8-byte aligned scalar values (*cough* 32-bit iOS). Work around this with our own union. See issue #64.

View File

@@ -407,7 +407,7 @@ class basic_memory_buffer: private Allocator, public internal::basic_buffer<T> {
// Move data from other to this buffer.
void move(basic_memory_buffer &other) {
Allocator &this_alloc = *this, &other_alloc = other;
this_alloc = std::move(other_alloc);
this_alloc = ::MoveTemp(other_alloc);
T* data = other.data();
std::size_t size = other.size(), capacity = other.capacity();
if (data == other.store_) {