mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 13:05:20 +01:00
[skip ci] Update README
This commit is contained in:
parent
f17a3bdc59
commit
0e184d07ce
@ -27,7 +27,6 @@ Lets say we have a csv file containing students in a given format '$name,$age,$g
|
|||||||
$ cat students.csv
|
$ cat students.csv
|
||||||
James Bailey,65,2.5
|
James Bailey,65,2.5
|
||||||
Brian S. Wolfe,40,1.9
|
Brian S. Wolfe,40,1.9
|
||||||
Nathan Fielder,37,Really good grades
|
|
||||||
Bill (Heath) Gates,65,3.3
|
Bill (Heath) Gates,65,3.3
|
||||||
```
|
```
|
||||||
```cpp
|
```cpp
|
||||||
@ -35,13 +34,11 @@ Bill (Heath) Gates,65,3.3
|
|||||||
#include <ss/parser.hpp>
|
#include <ss/parser.hpp>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
ss::parser p{"students.csv", ","};
|
ss::parser<ss::throw_on_error> p{"students.csv", ","};
|
||||||
|
|
||||||
for(const auto& [name, age, grade] : p.iterate<std::string, int, float>()) {
|
for (auto&& [name, age, grade] : p.iterate<std::string, int, float>()) {
|
||||||
if (p.valid()) {
|
|
||||||
std::cout << name << ' ' << age << ' ' << grade << std::endl;
|
std::cout << name << ' ' << age << ' ' << grade << std::endl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user