cpp_weekly
cpp_weekly copied to clipboard
The official C++ Weekly Repository. Code samples and notes of future / past episodes will land here at various times. PR's will be accepted in some cases.
**Channel** C++Weekly **Topics** - What is the execute-around pointer idiom. - How/when/why should you use it. - How does it work under the hood (I'm genuinely curious about this one):...
**Channel** C++Weekly **Topics** `std::format("{}");` does not compiles while `std::format("{}",1);` does. How is it possible? (a look into `std::format_string` implementation, and especially its constructor? How function arguments seem to be usable...
**Channel** C++Weekly **Topics** There are several ways of accessing the data in a `std::variant`, including `std::visit`, `std::get` and `std::get_if`. What are the best practices for using each of these functions?...
**Channel** C++ weekly **Topics** I have noticed that when using RAII the compiler isn't able to issue tail call optimization https://godbolt.org/z/WbP63ETE9 It would be interesting to explain the reason why...
**Channel** C++Weekly **Topics** A video about std::chrono. How to build something like Java's LocalDate, LocalDateTime and ZonedDateTime. **Length** 10-20 minutes
**Channel** C++Weekly **Topics** Why variable-length arrays are available in C++ as a compiler extension (why not part of standard and why not removed altogether). The good (they were added to...
https://en.cppreference.com/w/cpp/types/is_within_lifetime
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html
If you must do manual mutex locking - prefer this: https://en.cppreference.com/w/cpp/thread/scoped_lock (but prefer higher level constructs)