• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Scinonova logo
  • Start
  • Om oss
  • Karriär
  • Blogg
  • Kontakt
  • Svenska

6 Useful New Features in C++17 – Part 5

13 september, 2018 by Scionova

Constexpr lambdas

Since C++11 we are able to use the constexpr specifier which evaluates the expression at compile time, with C++17 lambdas can also be constant expressions. One use case could be to initialize constexpr variables that depend on other constexpr variables. See the following example:

This example maybe is silly but imagine a much more complex dependency and the array consists of more complex elements than simple integers.

Compiler Support

These features are all fully supported by GCC, MSVC, and clang. Below follows a table showing which version enables support for each feature respectively.

For more a detailed matrix with more compilers and all features of C++17 listed, follow this link.

 

Endnote

This was the last part of the series “6 Useful New Features in C++17” and I hope you found it helpful and interesting. All the previous blog posts in this series you will find under “NEWS“.

Don’t hesitate to share with your friends and colleagues and stay tuned for more!

 

 //Patrik Ingmarsson, Software Developer

Filed Under: Programmering

Improve your coding skills

2 July, 2018 | Scionova
Peter give his best tip on how you can improve your coding…

6 Useful New Features in C++17 - Part 1

29 August, 2018 | Scionova
In this 5 parts of blog series, Patrik from Scionova will talk…

6 Useful New Features in C++17 - Part 2

3 September, 2018 | Scionova
This is the second part of the series "6 Useful New Features…

6 Useful New Features in C++17 - Part 3

6 September, 2018 | Scionova
This is the third part of the series "6 Useful New Features…

6 Useful New Features in C++17 - Part 4

11 September, 2018 | Scionova
This is the fourth part of the series "6 Useful New Features…

6 Useful New Features in C++17 - Part 5

13 September, 2018 | Scionova
Constexpr lambdas Since C++11 we are able to use the constexpr specifier…

Footer

Göteborgskontoret


Theres Svenssons Gata 13,
417 55 Göteborg

Varbergskontoret


Kungsgatan 28b,
432 44 Varberg

Gasell