Compile-Time Magic: C++23’s std::expected and the Limits of Compile-Time Computation

Today, let’s talk about a “black magic” tool brought by C++23—std::expected. It is not just an upgraded version of error handling; it can perfectly combine with compile-time computation (constexpr), allowing you to handle “expected values” or “unexpected errors” at the compilation stage. Imagine calculating complex expressions during code compilation, returning error messages directly if something … Read more

Goals of C++ 23

Goals of C++ 23

Source: Zhihu, Author: Nanshan Yanyu Zhujiang TideLink: https://zhuanlan.zhihu.com/p/107360459 C++20 is the largest version ever, akin to constructing a beautiful skyscraper, but due to time constraints, the interior decoration is still incomplete, which feels like this: The primary task of C++23 is, of course, to continue the interior decoration of the building, so C++23 should look … Read more

Comparison of Features Across C++ Versions from C++98 to C++23

Comparison of Features Across C++ Versions from C++98 to C++23

Core Feature List of Major C++ Versions (Only the most critical changes in the standard are listed for quick reference): C++98 / C++03 (C++98 is the first ISO standard, C++03 is a technical revision, essentially the same) • Standard Template Library (STL): vector, list, map, algorithm, etc. • Exception handling <span>try / catch</span> • Namespaces … Read more

C++23 forward_like_tuple

C++23 forward_like_tuple

“Transferring a person’s warmth to another’s chest”—— Eason Chan “Love Transfer” Introduction The updates to the C++23 language core are minimal, and I have not felt motivated to upgrade. However, considering that next year is 2026, using C++23 still seems reasonable, right? Among the features in C++23 that can significantly simplify code, the most prominent … Read more

The Journey from C++98 to C++26

The Journey from C++98 to C++26

整理 | 王瑞平As a programmer, the most important topic to focus on in 2023 is the update of the C++ standard.The C++ standard follows a three-year development cycle and is named after the year of release. C++ enters a “feature freeze” one year before its release, meaning the version development enters a semi-stable state, and … Read more

Goals of C++ 23

Goals of C++ 23

Source: Zhihu, Author: Nanshan Yanyu Zhujiang TideLink: https://zhuanlan.zhihu.com/p/107360459 C++20 is the largest version ever, akin to constructing a beautiful skyscraper, but due to time constraints, the interior decoration is not yet complete, which feels like this: The primary task of C++23 is, of course, to continue the interior decoration of the building, so C++23 should … Read more

In-Depth Analysis of std::out_ptr and std::inout_ptr in C++23

In-Depth Analysis of std::out_ptr and std::inout_ptr in C++23

C++23 introduces two new standard library function templates<span><span>std::out_ptr</span></span> and <span><span>std::inout_ptr</span></span>, along with their corresponding types <span><span>std::out_ptr_t</span></span> and <span><span>std::inout_ptr_t</span></span>, aimed at enhancing the readability and safety of code interacting with C-style APIs. This article will provide a technical analysis of the design motivations, functional details, usage scenarios, and implementation mechanisms of these two new features, ensuring … Read more

The Right Way to Open ‘C++ Journey’

The Right Way to Open 'C++ Journey'

Be brief when giving instructions! ——Cicero Modern C++ feels like a new language. I mean, compared to C++98 or C++11, I can express my ideas more clearly, simply, and directly now. Not only that, programs generated by modern C++ are also easier for compilers to check and run faster. ‘C++ Journey’ showcases the overview of … Read more