diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-30 09:51:54 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-30 09:51:54 -0500 |
commit | 6c7fd1db481ff10a16ecab958c6542784fa60b9c (patch) | |
tree | e0162f930ec44a7c53b07061311d52910c36e481 /include/fud_drain.hpp | |
parent | 8dcb1de91e15ff7fc66279cd9cd9ad8a70f624e0 (diff) |
Use std::byte* instead of void* for allocators.
Diffstat (limited to 'include/fud_drain.hpp')
-rw-r--r-- | include/fud_drain.hpp | 12 |
1 files changed, 11 insertions, 1 deletions
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 <typename Sink, typename Source> +concept Drainable = requires (Sink sink, Source source) +{ + { sink.drain(source) } -> std::same_as<DrainResult>; }; } // namespace fud |