From 9073996fe8b0bb6ca1a6b73be03267b7c9efead1 Mon Sep 17 00:00:00 2001 From: Mathias Lang Date: Tue, 20 Feb 2024 11:56:55 +0100 Subject: [PATCH] Make Channel postblit / dtor scope This allows them to be used in scope contexts, and to have the generated opAssign be scope. --- source/vibe/core/channel.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/vibe/core/channel.d b/source/vibe/core/channel.d index c3551368..3e958df3 100644 --- a/source/vibe/core/channel.d +++ b/source/vibe/core/channel.d @@ -65,8 +65,8 @@ struct Channel(T, size_t buffer_size = 100) { private shared(ChannelImpl!(T, buffer_size)) m_impl; - this(this) @safe { if (m_impl) m_impl.addRef(); } - ~this() @safe { if (m_impl) m_impl.releaseRef(); } + this(this) scope @safe { if (m_impl) m_impl.addRef(); } + ~this() scope @safe { if (m_impl) m_impl.releaseRef(); } /** Determines whether there is more data to read in a single-reader scenario.