csv-parser icon indicating copy to clipboard operation
csv-parser copied to clipboard

begin() iterator does not always point to begin()

Open definable opened this issue 7 months ago • 0 comments

begin() iterator is expect to to point to the first row when used. This is not the case, the begin iterator increments.

The following returns values from 3 different rows:

auto s1 = (*reader.begin())[1].get();
auto s2 = (*reader.begin())[1].get();
auto s3 = (*reader.begin())[1].get();


for(::csv::CSVRow& row : reader)
{
}
auto s1 = (*reader.begin())[1].get();  <= index out of bounds:  begin() == end()

definable avatar Mar 13 '25 10:03 definable