Bruno BELANYI
bd072e1025
Unfortunately, `std::ostream_iterator` puts its separator *after* every element, not *in-between* each element.
21 lines
422 B
C++
21 lines
422 B
C++
#include "write-csv.hh"
|
|
|
|
#include <algorithm>
|
|
#include <iostream>
|
|
#include <iterator>
|
|
|
|
namespace kraken::csv {
|
|
|
|
void write_csv(std::ostream& output, csv_type const& csv) {
|
|
for (const auto& line : csv) {
|
|
bool first = true;
|
|
for (const auto& atom : line) {
|
|
output << (first ? "" : ",") << atom;
|
|
first = false;
|
|
};
|
|
output << '\n';
|
|
}
|
|
}
|
|
|
|
} // namespace kraken::csv
|