Peter Gottschling presented in his last post "std::format in C++20" the basics to the new formatting library in C++20. In today's post Peter writes about the formatting of user-defined types.
Today, I'm happy to present Peter Gottschling's guest post to the new formatting library in C++20: std::format. Thanks to std::format, text formatting becomes in C++20 as easy as in Python.
Removing elements from a container or asking if an associative container has a specific key, is too complicated. I should say was because with C++20 the story changes.
Probably the most viral keyword in modern C++ is constexpr. With C++20, we have a constexpr std::vector and a constexpr std::string. Additionally, both containers can be manipulated with the constexpr algorithms of the Standard Template Library.
In my seminar, I often hear the question: How can I safely pass a plain array to a function? With C++20, the answer is quite easy: Use a std::span.
Last week, I launched a quiz. The price was it to win one of the five vouchers for the book "Modern C++ for Absolute Beginners" from Slobodan Dmitrović.
Is it possible to introduce C++ in 300 pages? Yes, it is. The book "Modern C++ for Absolute Beginners" from Slobodan Dmitrović proves it.
Today, I complete my tour through the C++20 core language features with a few small improvements. One interesting of these minor improvements is that most of volatile has been deprecated.
With C++20, we got new and improved attributes such as [[nodiscard("reason")]], [[likely]], [[unlikely]], and [[no_unique_address]]. In particular, [[nodiscard("reason")]] allows it to express the intention of your interface way clearer.
Do you know that PVS-Studio is integrated into the Compiler Explorer? If not, you should definitely read this guest post from Andrey Karpov including a promo code.
Hunting
Today 6883
Yesterday 7909
Week 14792
Month 89843
All 6110907
Currently are 139 guests and no members online
Kubik-Rubik Joomla! Extensions
Read more...
Read more...