Added clang-tidy config and cleaned up the code a little.

This commit is contained in:
2024-08-18 13:30:40 +02:00
parent 9f011952c2
commit 6d111904d4
7 changed files with 142 additions and 65 deletions

View File

@@ -4,7 +4,6 @@
#if !defined(MIJIN_IO_STREAM_HPP_INCLUDED)
#define MIJIN_IO_STREAM_HPP_INCLUDED 1
#include <cassert>
#include <cstdint>
#include <optional>
#include <ranges>
@@ -322,8 +321,9 @@ public:
}
void close();
[[nodiscard]] inline bool isOpen() const { return data_.data() != nullptr; }
[[nodiscard]] inline std::size_t availableBytes() const {
assert(isOpen());
[[nodiscard]] inline std::size_t availableBytes() const
{
MIJIN_ASSERT(isOpen(), "MemoryStream is not open.");
return data_.size() - pos_;
}