io/BufferedReader: add method ReadFullT()

This commit is contained in:
Max Kellermann 2022-05-11 11:53:48 +02:00
parent fb961e89da
commit a375f0f160

View File

@ -66,6 +66,18 @@ public:
*/
void ReadFull(std::span<std::byte> dest);
template<typename T>
void ReadFullT(T &dest) {
ReadFull({&dest, sizeof(dest)});
}
template<typename T>
T ReadFullT() {
T dest;
ReadFullT<T>(dest);
return dest;
}
char *ReadLine();
unsigned GetLineNumber() const noexcept {