Constant Fun

By Dietmar Kühl

This presentation discusses why it is useful to move some of the processing to compile time and shows some applications of doing so. In particular it shows how to create associative containers created at compile time and what is needed from the types involved to make it possible. The presentation also does some analysis to estimate the costs in terms for compile-time and object file size.

Specifically, the presentation discusses:

  • implications of static and dynamic initialization – the C++ language rules for implementing constexpr functions and classes supporting constexpr objects.

  • differences in error handling with constant expressions.

  • sorting sequences at compile time and the needed infrastructure – creating constant associative containers with compile-time and run-time look-up.

It is expected that attendees have a working knowledge of C++ but no prior knowledge of using constexpr is required. The code samples will contain lots of templates and sometimes unusual uses of the language.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.