User Tools

Site Tools


2015:compile-time_computations_in_c_14

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
2015:compile-time_computations_in_c_14 [2014/10/29 07:16] – created jonjagger2015:compile-time_computations_in_c_14 [2016/06/11 14:05] (current) – external edit 127.0.0.1
Line 6: Line 6:
 **Duration**: 90 mins\\ **Duration**: 90 mins\\
 **Description**: \\ **Description**: \\
-While in the past C++ provided compile-time computation only very clumsily using templates with value parameters, C++11 introduced the constexpr keyword and allows functions and constants to be computed at compile time. It even introduced a new category of types "Literal Typesthat can be used in such compile-time computations. C++14 further relaxed the restrictions on constexpr functions to allow all reasonable statements that make sense at compile time. As long as at compile-time the computation path of a function remains within these limitations regular C++ can be used in constexpr function. However, when exploring/exploiting the compile-time computation features, one will recognize there are limitations and compile-time impacts can be really severe.\\+While in the past C++ provided compile-time computation only very clumsily using templates with value parameters, C++11 introduced the constexpr keyword and allows functions and constants to be computed at compile time. It even introduced a new category of types 'Literal Typesthat can be used in such compile-time computations. C++14 further relaxed the restrictions on constexpr functions to allow all reasonable statements that make sense at compile time. As long as at compile-time the computation path of a function remains within these limitations regular C++ can be used in constexpr function. However, when exploring/exploiting the compile-time computation features, one will recognize there are limitations and compile-time impacts can be really severe.\\
 \\ \\
 The tutorial covers many kinds of compile-time computations available in C++14, from constexpr functions and constants, literal types, variable templates, up to variadic templates using std::integer_sequence for string processing. It also gives a glimpse of the potential future standardized features, like user-defined-literal template operators for string literals. The tutorial also shows, where C++14 still has limitations in supporting compile-time computations and what you might need to do, to sidestep them.\\ The tutorial covers many kinds of compile-time computations available in C++14, from constexpr functions and constants, literal types, variable templates, up to variadic templates using std::integer_sequence for string processing. It also gives a glimpse of the potential future standardized features, like user-defined-literal template operators for string literals. The tutorial also shows, where C++14 still has limitations in supporting compile-time computations and what you might need to do, to sidestep them.\\
2015/compile-time_computations_in_c_14.1414566977.txt.gz · Last modified: 2016/06/11 14:05 (external edit)