Paul Krill
Editor at Large

Visual Studio 2019 gains C++ Concepts

news
Sep 12, 20192 mins

Concepts allow the C++ programmer to document constraints on templates and have the compiler enforce them

flow chart diagram / objects / elements / connections / programming / development / planning
Credit: SPainter VFX / Getty Images

C++ 20 Concepts, which can help developers write more concise C++ code, are now supported in a beta release of the upcoming Visual Studio 2019 IDE.

Supported in Visual Studio 2019 Preview 2, C++ Concepts are predicates used to express a generic algorithm’s expectations on its template arguments. Concepts allow developers to document constraints on templates that are enforced by the compiler. Compile times can be improved by Concept-based overloading.

Support for C++ Concepts is built into both the compiler and the standard library. The feature is being debuted through a /std:c++latest mode. Once all C++ 20 features are implemented across all Visual Studio products, including the compiler, the library, IntelliSense, the builder, and the debugger, Microsoft will provide them through a /std:c++20 mode. IntelliSense support is not currently available and Microsoft’s implementation does not yet include recent changes made in ISO C++ standards.

Specifically, the compiler supports capabilities such as:

  • C++ extensions for Concepts.
  • Semantic constraint matching for concepts.

Microsoft is working on support for C++ ranges, providing components for dealing with ranges of element and tightly linked to Concepts. Microsoft is seeking feedback on Concepts, which can be left on a company blog post or via the Report a Problem tool in Visual Studio.

You can download the Visual Studio 2019 preview from the Visual Studio website.

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