mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
common/alignment: Fix VS2022 compilation
VS2022 seems to introduce an optimization when moving vectors to check for equality of the element values. AlignmentAllocator needed to overload the equality operator to fix compilation of its usage in vector moving.
This commit is contained in:
parent
b01aa721ff
commit
1841f63a40
1 changed files with 6 additions and 1 deletions
|
@ -64,7 +64,7 @@ public:
|
||||||
using propagate_on_container_copy_assignment = std::true_type;
|
using propagate_on_container_copy_assignment = std::true_type;
|
||||||
using propagate_on_container_move_assignment = std::true_type;
|
using propagate_on_container_move_assignment = std::true_type;
|
||||||
using propagate_on_container_swap = std::true_type;
|
using propagate_on_container_swap = std::true_type;
|
||||||
using is_always_equal = std::true_type;
|
using is_always_equal = std::false_type;
|
||||||
|
|
||||||
constexpr AlignmentAllocator() noexcept = default;
|
constexpr AlignmentAllocator() noexcept = default;
|
||||||
|
|
||||||
|
@ -83,6 +83,11 @@ public:
|
||||||
struct rebind {
|
struct rebind {
|
||||||
using other = AlignmentAllocator<T2, Align>;
|
using other = AlignmentAllocator<T2, Align>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T2, size_t Align2>
|
||||||
|
constexpr bool operator==(const AlignmentAllocator<T2, Align2>&) const noexcept {
|
||||||
|
return std::is_same_v<T, T2> && Align == Align2;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|
Loading…
Reference in a new issue