mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
AK: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes in default impls
This commit is contained in:
parent
3d3dfc8da8
commit
041f5e931d
3 changed files with 4 additions and 16 deletions
|
@ -21,6 +21,7 @@ concept SeekableStreamLike = IsBaseOf<SeekableStream, T>;
|
|||
template<typename T>
|
||||
class BufferedHelper {
|
||||
AK_MAKE_NONCOPYABLE(BufferedHelper);
|
||||
AK_MAKE_DEFAULT_MOVABLE(BufferedHelper);
|
||||
|
||||
public:
|
||||
template<StreamLike U>
|
||||
|
@ -30,19 +31,6 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
BufferedHelper(BufferedHelper&& other)
|
||||
: m_stream(move(other.m_stream))
|
||||
, m_buffer(move(other.m_buffer))
|
||||
{
|
||||
}
|
||||
|
||||
BufferedHelper& operator=(BufferedHelper&& other)
|
||||
{
|
||||
m_stream = move(other.m_stream);
|
||||
m_buffer = move(other.m_buffer);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<template<typename> typename BufferedType>
|
||||
static ErrorOr<NonnullOwnPtr<BufferedType<T>>> create_buffered(NonnullOwnPtr<T> stream, size_t buffer_size)
|
||||
{
|
||||
|
|
|
@ -15,14 +15,12 @@ namespace AK {
|
|||
|
||||
class CircularBuffer {
|
||||
AK_MAKE_NONCOPYABLE(CircularBuffer);
|
||||
AK_MAKE_DEFAULT_MOVABLE(CircularBuffer);
|
||||
|
||||
public:
|
||||
static ErrorOr<CircularBuffer> create_empty(size_t size);
|
||||
static ErrorOr<CircularBuffer> create_initialized(ByteBuffer);
|
||||
|
||||
CircularBuffer(CircularBuffer&& other) = default;
|
||||
CircularBuffer& operator=(CircularBuffer&& other) = default;
|
||||
|
||||
~CircularBuffer() = default;
|
||||
|
||||
size_t write(ReadonlyBytes bytes);
|
||||
|
|
|
@ -36,6 +36,8 @@ public:
|
|||
}
|
||||
|
||||
SourceGenerator(SourceGenerator&&) = default;
|
||||
// Move-assign is undefinable due to 'StringBuilder& m_builder;'
|
||||
SourceGenerator& operator=(SourceGenerator&&) = delete;
|
||||
|
||||
ErrorOr<SourceGenerator> fork()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue