From 6c7fd1db481ff10a16ecab958c6542784fa60b9c Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Wed, 30 Oct 2024 09:51:54 -0500 Subject: Use std::byte* instead of void* for allocators. --- include/fud_drain.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include/fud_drain.hpp') diff --git a/include/fud_drain.hpp b/include/fud_drain.hpp index 5b78b10..d630bc7 100644 --- a/include/fud_drain.hpp +++ b/include/fud_drain.hpp @@ -26,8 +26,18 @@ namespace fud { struct DrainResult { - size_t bytesWritten; + size_t bytesDrained; FudStatus status; + [[nodiscard]] constexpr bool isOkay() + { + return status == FudStatus::Success; + } +}; + +template +concept Drainable = requires (Sink sink, Source source) +{ + { sink.drain(source) } -> std::same_as; }; } // namespace fud -- cgit v1.2.3