Introduction to one of the new features in c++23

1. The goal and extension of c++23

The standard development speed of c++ has entered the fast lane after the almost innovative changes of c++11. Some people say on the Internet that the C++ language after C++11 and the C++ language before C++11 are not the same language, which is a bit exaggerated. But it is undeniable that its content has indeed changed a lot. Many people may not feel the changes in the new c++ standard, after all, the domestic application is still relatively shallow. However, c++14 and c++17 were launched quickly, and before the c++ developers could recover, c++20 appeared impatiently. fast? unhappy. No, the c++23 standard is basically finalized now.
And c++26 will also start the formulation of standards this year, and c++29 has also started planning.
From past development to future planning, excluding special circumstances (covid-19 has an impact on c++23), it can be basically seen clearly that the new standard of c++ is a wavy gradual process of presenting size, which can be understood as Once there is a major standard improvement, it will be improved and iteratively expanded in a subsequent version; then a major standard improvement will be made, and it will be improved again, and so on.
In reality, c++11's changes to the c++ language can be said to be refreshing, while c++14 is relatively small, and hardly anything new has been introduced. Although c++17 has made breakthroughs, But it still maintains a medium-sized upward expansion trend until c++20 introduces four new features such as concepts. c++23 is actually closer to the changes of c++17, but due to some special circumstances, some details may not be completed in the end, so c++26 may be relatively large, but the real big changes may be in c++29 produced. Of course, the former is a fact that has become, while the latter is a kind of planning, which depends on the final result.
For the formulation of the C++ standard, it is roughly divided into two parts, one is the formulation of the C++ language feature itself; the other is the formulation of the C++ standard library feature.
It is obvious that the difficulty of the former is much greater than that of the latter.
As for the relevant standard proposals involved in the standard change, if you are interested, you can search online, especially on the standard website, you can see the relevant classification methods such as T0, T0.5, T1, T2, T3 and the conditions for application division.

2. New features of c++23

The new features of c++23 are introduced from two aspects, namely the language itself and STL features.
A. Language features
1. Display this
2. Multidimensional array support operator[]
3. Size_t literal support
4. Floating point literals
5. Assume expressions
6. New preprocessing instructions
7. Lambda simplification
8. Enhancement of UNICODE escape characters
9, displayed Move
10, and enhancement of CATD
These are new language features that seem relatively clear.

B. Standard library features
1. stl import application
2. Exception and formatted output
3. std::generator of coroutine
4. mdspan multi-data view
5. Flat container
6. Stack information library
7. Zip series
8. Heterogeneity Improvement and update of details of container members
9, a large number of libraries, and BUG FIX

The follow-up of domestic books is too slow, and there are relatively few domestic related articles. It is recommended to read more foreign books (of course, the premise is to be able to read them). For example, the latest c++ template programming uses a lot of new c++ standards. There are very few books related to c++20 in China. Of course, this is also due to the domestic environment. After all, C++ is a language that is no longer popular in China. Even if it looks like it is shining again now, we have to look again.
Later articles will analyze and explain some of these features, so I won't expand the explanation here.

3. Summary

In c++23, what everyone is looking forward to is actually the improvement and final application of some new standards of c++20. The focus is on the application of coroutines in STL, the application of Modules in the standard library, Executors and network libraries. But at present, the latter two are more troublesome. It was originally thought that Executors should be relatively easy. However, the final result has not come out, and I still dare not say clearly. It is a good thing that the standard is constantly iterating, and no one wants to see an old face unchanged.
After the standard is formulated, the follow-up of compilers and IDEs is estimated to be delayed by the first half to a year, that is to say, it will be used (not trial) next year. However, many compilers will support some relevant parts of their own proposals or some interesting parts. You can try this, but it is just a try. The risk is a bit high in actual projects.

Guess you like

Origin blog.csdn.net/fpcc/article/details/129998163