Paul Krill
Editor at Large

C++ 20 receives final technical approval

news
Sep 10, 20202 mins

C++ language upgrade featuring modules and coroutines is set to be released before the end of the year

thumbs up multicultural
Credit: TNS Sofres

Having attained final technical approval from ISO on September 4, C++ 20 is expected to be formally published toward the end of this year, introducing new features such as modules and coroutines.

Designed in 1979 for systems programming, C++ remains a vital language. C++ was even found to be the fastest-growing language in the Tiobe Index of September 2020, where it ranks in fourth place behind C, Java, and Python. Tiobe cites the C++ 20 specification as one of the factors giving the language a boost.

New capabilities in C++ 20 include:

  • Modules, enabling programmers to use modular components.
  • Concepts, used to specify template requirements and support generic programming. Concepts promise to improve code quality.
  • A synchronization library, for better support of fine-grained hardware control.
  • Compile-time computation improvements.
  • Coroutines, which generalize subroutines for use in nonpreemptive multi-tasking. Standardized support for coroutines in the standard library is still lacking, however. This support is eyed for C++ 23.
  • Ranges, which provide components to deal with ranges of elements.
  • Feature test macros, a set of macros that correspond to language and library features from C++ 11 or later.
  • Precalculated hash values in lookup.
  • Expansion statements to enable compile-time repetition of a statement for each element of a tuple, array, class, parameter pack, or range.
  • Monadic operations for std::optionalcode.
  • Implicit creation of objects for low-level manipulation.
  • Improved context-sensitive recognition of import and module to aid non-compiler tools to determine build dependencies.
  • New rangified algorithms.

A contracts capability that had been expected in C++ 20, to specify pre-conditions, post-conditions, and assertions, has been removed. Contracts is now marked as a C++ 23 item, although it may not make it into that release, either.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author