Buffer type has to be moveable, always

This commit is contained in:
2025-05-17 23:01:51 +02:00
parent e7e7023340
commit 54b95b1662
2 changed files with 34 additions and 5 deletions

View File

@ -16,7 +16,8 @@
namespace asl
{
template<is_object T, allocator Allocator = DefaultAllocator>
template<typename T, allocator Allocator = DefaultAllocator>
requires is_object<T> && moveable<T>
class buffer
{
T* m_data{};
@ -244,7 +245,6 @@ public:
}
constexpr buffer(buffer&& other)
requires moveable<T>
: buffer(std::move(other.m_allocator))
{
move_from_other(std::move(other), false);
@ -259,7 +259,6 @@ public:
}
constexpr buffer& operator=(buffer&& other)
requires moveable<T>
{
if (&other == this) { return *this; }
move_from_other(std::move(other), true);