官术网_书友最值得收藏!

More C++20 features

C++20 is a new big release of the C++ language. It contains many features that make the language more complex and flexible. Concepts, ranges, and coroutines are some of the many features that will be discussed throughout the book.

One of the most anticipated features is modules, which provide the ability to declare modules and export types and values within those modules. You can consider modules an improved version of header files with the now redundant include-guards. We'll cover C++20 modules in this chapter.

Besides notable features added in C++20, there is a list of other features that we will discuss throughout the book:

  • The spaceship operator: operator<=>(). The verbosity of operator overloading can now be controlled by leveraging operator<=>().
  • constexpr conquers more and more space in the language. C++20 now has the consteval function, constexpr std::vector and std::string, and many more.
  • Math constants, such as std::number::pi and std::number::log2e.
  • Major updates to the Thread library, including stop tokens and joining threads.
  • The iterator concepts.
  • Move-only views and other features.

To better understand some new features and also dive into the essence of the language, we will introduce the language's core starting from previous versions. This will help us to find better uses for new features compared to older ones, and will also help in supporting legacy C++ code. Let's now start by gaining an understanding of the C++ application building-process.

主站蜘蛛池模板: 建阳市| 若尔盖县| 密云县| 崇阳县| 金华市| 琼中| 汕尾市| 澄城县| 建宁县| 庆城县| 扎鲁特旗| 县级市| 万州区| 镇巴县| 江城| 顺平县| 比如县| 垣曲县| 齐齐哈尔市| 福海县| 响水县| 舒城县| 甘孜| 蒙自县| 巴林右旗| 招远市| 崇州市| 惠水县| 通江县| 佛坪县| 镇坪县| 泸定县| 东平县| 阳曲县| 确山县| 岱山县| 法库县| 连南| 襄垣县| 永平县| 栖霞市|