diff --git a/include/csv2/reader.hpp b/include/csv2/reader.hpp index 45ffb80..45cffea 100644 --- a/include/csv2/reader.hpp +++ b/include/csv2/reader.hpp @@ -247,9 +247,10 @@ class Reader { size_t cols() const { size_t result{0}; - for (const auto cell : header()) + const auto row = header(); + for (auto cell = row.begin(); cell != row.end(); ++cell) result += 1; return result; } }; -} // namespace csv2 \ No newline at end of file +} // namespace csv2