Really good and informative presentation! Addendum: 1. Using pairs and tuples regularly can make your code unreadable in short time. C++ really misses the feature of (C# like) anonymous types. Now it's better to define new structs with meaningful member names instead of using pairs or tuples. 2. You mostly should use sum types through visitors! Using get, holds_alternative, get_value or has_value regularly is like using dynamic_cast regularly in OOP. Sometimes it's necessary but not really safe or pragmatic in most cases.
The talk was a great overview of the ADTs present in the standard library. I definitely learned a few things about using those types. Not sure why you spent any time on valueless_by_exception at all. Almost nobody should ever be catching bad_alloc, especially those people who are being targeted by these B2B talks.
Gotta say the term algebraic proved to be somewhat confusing (clicked the video to find out how to express vectors and other niceties in C++ data types).
std::optional seems to have been designed as though they purposefully want it to be bad/fail. Why on earth, is there no overload for value_or that takes a function callback which it calls if it has no value? Then it would only lazily call that when you call value_or, which *IS* what people expect that value_or call to actually mean / do.
Of the instructional videos I watch, which are numerous, you have one of the most pleasant and thus accessible deliveries.
Thanks, Arthur, I love all your talks, it's just good.
Really good and informative presentation!
Addendum:
1. Using pairs and tuples regularly can make your code unreadable in short time. C++ really misses the feature of (C# like) anonymous types. Now it's better to define new structs with meaningful member names instead of using pairs or tuples.
2. You mostly should use sum types through visitors! Using get, holds_alternative, get_value or has_value regularly is like using dynamic_cast regularly in OOP. Sometimes it's necessary but not really safe or pragmatic in most cases.
I'm happy that ABTs are now expressible in C++. It's so useful to have a sum type! :)
The talk was a great overview of the ADTs present in the standard library. I definitely learned a few things about using those types.
Not sure why you spent any time on valueless_by_exception at all. Almost nobody should ever be catching bad_alloc, especially those people who are being targeted by these B2B talks.
very complete intruction...thanks!
Thanks, Mr.Arthur
Very interesting and informative!
As usual another great video
Thanks again!
*Excellent*
good article
std::visit supporting multiple variant types are very cool. It can be used to implement a poor man's multiple dispatch.
Gotta say the term algebraic proved to be somewhat confusing (clicked the video to find out how to express vectors and other niceties in C++ data types).
std::optional seems to have been designed as though they purposefully want it to be bad/fail. Why on earth, is there no overload for value_or that takes a function callback which it calls if it has no value? Then it would only lazily call that when you call value_or, which *IS* what people expect that value_or call to actually mean / do.
Thanks! Interesting and useful, but very fast speech, hard for understand.