Hello all,
We had a fun evening on Tuesday October 15th, discussing C++ STL, Data structure and various modern techniques. The inspiration coming from a recently published book by John Farrier:
recording:
Event page here.
Hey everyone,
Here’s a quick recap of our discussion:
We kicked things off with cppquiz 167. It’s a tough one but packed with important modern C++ concepts like RValue, LValue, and what happens when you pass an RValue to a function. We also touched on std::move and std::forward. Give it a shot and make sure to read the explanation!
C++ Data Structures and STL:
- We talked about getters and exposing internal data structures from your class. We also introduced alternatives like iterators and discussed how to write them in different ways.
SFINAE and std::void_t:
- We covered how SFINAE tweaks the compiler’s function candidate list, mentioned C++20 concepts, and how std::void_t can help. We also discussed type_traits, if constexpr, static_assert(), declval, and how cppinsights.io can be useful.
Allocator Interface:
- How to use it with STL containers.
std::span<> Example:
- We went through an example of std::span<>.
Gotchas:
- Comparing two strings or comparing pointers? Check out the last 2-3 minutes of the recording for the full details!
Book Recommendation:
- I liked the book, though it was a bit basic for me. However, I think it’s great for newcomers to the language/STL to get familiar with various containers, algorithms, and other parts of the Standard Template Library.
Thanks for reading!
Kobi