The README gives the following example for how to use a mix of required and optional columns:
#include "csv.h"
int main() {
// The file only contains the columns "a" and "b"
io::CSVReader<2>in("test.csv");
in.read_header(io::ignore_missing_column, "a", "b", "sum");
if (!in.has_column("a") || !in.has_column("b")) {
throw io::error::missing_column_in_header();
}
bool has_sum = in.has_column("sum");
int a, b, sum;
while (in.read_row(a, b, sum)) {
if (!has_sum)
sum = a + b;
}
}
This gives a static error too many columns specified. It appears it's a typo and template column count should be 3.
The README gives the following example for how to use a mix of required and optional columns:
This gives a static error
too many columns specified
. It appears it's a typo and template column count should be 3.