-
-
Save rightfold/7f8d575de564bad77ee3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename Reader> | |
void read_full(Reader&& reader, char* begin, char* end) { | |
while (begin != end) { | |
auto new_begin = reader.read(begin, end); | |
if (new_begin == begin) { | |
throw unexpected_eof(__func__); | |
} | |
begin = new_begin; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment