io: Fix name lookup for read_exact friend specializations

This commit is contained in:
James R 2023-05-23 23:05:44 -07:00
parent a2ea3bfd6c
commit f35de20c72

View file

@ -448,7 +448,14 @@ public:
return head_;
}
friend void read_exact(SpanStream& stream, tcb::span<std::byte> buffer)
friend void read_exact(SpanStream& stream, tcb::span<std::byte> buffer);
private:
tcb::span<std::byte> span_;
std::size_t head_ {0};
};
inline void read_exact(SpanStream& stream, tcb::span<std::byte> buffer)
{
const std::size_t remaining = stream.span_.size() - stream.head_;
const std::size_t buffer_size = buffer.size();
@ -470,11 +477,6 @@ public:
std::copy(copy_begin, copy_end, buffer.begin());
}
private:
tcb::span<std::byte> span_;
std::size_t head_ {0};
};
class VecStream {
std::vector<std::byte> vec_;
std::size_t head_ {0};
@ -543,7 +545,10 @@ public:
std::vector<std::byte>& vector() { return vec_; }
friend void read_exact(VecStream& stream, tcb::span<std::byte> buffer)
friend void read_exact(VecStream& stream, tcb::span<std::byte> buffer);
};
inline void read_exact(VecStream& stream, tcb::span<std::byte> buffer)
{
const std::size_t remaining = stream.vec_.size() - stream.head_;
const std::size_t buffer_size = buffer.size();
@ -564,7 +569,6 @@ public:
std::copy(copy_begin, copy_end, buffer.begin());
}
};
class ZlibException : public std::exception {
int err_ {0};