Skip to content

Commit

Permalink
refs #118 Более общий интерфейс функции
Browse files Browse the repository at this point in the history
  • Loading branch information
izvolov committed Jun 27, 2020
1 parent 5664363 commit 329f1be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions benchmark/include/utility/io/generate.hpp
Expand Up @@ -8,15 +8,16 @@
#include <cstddef>
#include <cstdint>
#include <functional>
#include <iostream>
#include <ostream>
#include <random>
#include <vector>

namespace utility
{
void
std::ostream &
generate
(
std::ostream & stream,
std::size_t range_count,
std::size_t range_length,
std::int64_t min,
Expand Down Expand Up @@ -51,8 +52,10 @@ namespace utility
}
}

write(std::cout, range);
write(stream, range);
}

return stream;
}
} // namespace utility

Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/range_generator.cpp
Expand Up @@ -51,7 +51,7 @@ int main (int argc, const char * argv[])
bool sort = vm["sort"].as<bool>();
bool descending = vm["descending"].as<bool>();

utility::generate(range_count, range_length, min, max, seed, sort, descending);
utility::generate(std::cout, range_count, range_length, min, max, seed, sort, descending);
}
}
catch (std::exception &)
Expand Down

0 comments on commit 329f1be

Please sign in to comment.