idioms - RawIron/learn-cpp GitHub Wiki
C++20 ranges
-
command-line arguments
-
configuration file
-
encode and decode Jason
- function with multiple return values
pair<string, int> do_something() {
...
return make_pair(name, age);
}
int main() {
string name{};
int age{};
tie(name, age) = do_something();
}
https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
- filter
- sum
#include <numeric>
sum_of_scores = std::accumulate(scores.begin(), scores.end(),
decltype(scores)::value_type(0));
https://stackoverflow.com/questions/3221812/how-to-sum-up-elements-of-a-c-vector
- C++20 list slices
[4:6]
[4:]
[:9]
[1:-3]
- C++20 yield -> co-routines, generators