Added tests

This commit is contained in:
2019-12-19 02:23:45 +01:00
parent 42ca9fefff
commit 4718a1827a
3 changed files with 381 additions and 62 deletions

View File

@@ -62,7 +62,7 @@ namespace io {
// @todo Merge this into one function with the proper default automatically
template <Container T>
void write(std::ostream& os, T value, bool store_length = true) {
void write(std::ostream& os, const T& value, bool store_length = true) {
if (store_length) {
write<size_t>(os, value.size());
}
@@ -72,7 +72,7 @@ namespace io {
}
template <Container T> requires requires (T a) { std::tuple_size<T>::value; }
void write(std::ostream& os, T value, bool store_length = false) {
void write(std::ostream& os, const T& value, bool store_length = false) {
if (store_length) {
write<size_t>(os, value.size());
}