We see at least one major implementation that has all C++17 features in the same year that [it] is published…all of the major compilers’ current releases are in closer sync with the standard than they’ve ever been before.

Does the availability of compiler support mean that embedded developers will adopt the new C++ language straight away?

It's possible, but unlikely.

4 Questions to Ask Before Adopting C++17

You'll need to weigh the benefits with potential drawbacks.

Consider the following questions:

Will it save development time?

Will it reduce code maintenance costs?

Will it improve runtime performance?

Will it reduce safety and security risks?

Pros and Cons of C++17 Features

C++17 includes features that improve your code, performance, and security. While these are nice features, they're not earth-shattering.

Algorithm Optimization

One of the biggest additions is the introduction of the parallel algorithms library.

Multi-processor systems are required for computer-intensive programs and artificial intelligence. The parallel algorithms library makes it easier to execute standardized algorithms on this type of system.

Better Performance

“Guaranteed copy elision” is designed for improved compiler optimization. So, it may improve runtime performance.

Safety and Security

C++17 features will improve the safety of your program and ensure secure coding, including the following:

Removal of trigraphs and dynamic exception specifications.

Stricter order of expression evaluation.

Introduction of std::byte type.

The first two features prevent unspecified or undefined behavior.

The std::byte feature improves type safety. It distinguishes byte-oriented access to memory from accessing memory as a character or integral value. It also improves readability. The intent of the code is clearer.

Are C++17 Features Supported by Compliance Standards?

Compliance can be a barrier to C++17 adoption. And in order to adopt a new version of embedded C++, you need to be certain that you can use it and still be compliant. And that means having a coding standard that supports your language.

Move to Modern C++

Richard Bellairs

Product Marketing Manager, Perforce

Richard Bellairs has 20+ years of experience across a wide range of industries. He held electronics and software engineering positions in the manufacturing, defense, and test and measurement industries in the nineties and early noughties before moving to product management and product marketing. He now champions Perforce’s market-leading code quality management solution. Richard holds a bachelor’s degree in electronic engineering from the University of Sheffield and a professional diploma in marketing from the Chartered Institute of Marketing (CIM).