ben-strasser / fast-cpp-csv-parser

fast-cpp-csv-parser
BSD 3-Clause "New" or "Revised" License
2.09k stars 435 forks source link

Static_assert failed due to requirement 'sizeof...(ColType) >= 3U' "not enough columns specified" #107

Closed 0tist closed 4 years ago

0tist commented 4 years ago

`int main(){

io::CSVReader<3> in("g.csv");
in.read_header(io::ignore_extra_column, "index", "g", "label");
vector<double> g;
vector<int> labels;
int label; double score;
while(in.read_row(score, label)){
    cout<<score<<" : "<<label;
// do stuff with the data
}

return 0;

}`

0tist commented 4 years ago

I have 3 columns in my dataset: index, g and label. I can't figure out the problem

ben-strasser commented 4 years ago

while(in.read_row(score, label)

not enough coumns specified.

Try

while(in.read_row(index, score, label)

or something similar. :)