CppCon 2016: Peter Gottschling “How bad is Meta-Programming still today?'

preview_player
Показать описание


When innovation-hungry programmers discovered by accident that C++ allows us to calculate and transform programs at compile time, an humongous hype was triggered: gigantic research projects were launched to develop self-optimizing software. Unfortunately, such software also had gigantic compile times of up to several days on parallel machines. And the syntax of template meta-programming can drive the toughest geeks into insanity. Despite this disillusion, the compiler support improved over the years and constexpr brought us a much simpler syntax.

In this light we like to ask the questions: What can,
should, and must we compute at compile time? Which new opportunities offer constexpr and their extension in C++14? What have to be done in the classical manner still? We will discover the different techniques of meta-programming with examples of simple examples, type information, expression templates and meta-tuning. Without becoming unbearably theoretical, we will show the equivalence of constexpr in C++11 and C++14 and their Turing completeness.

Peter Gottschling
CEO, SimuNova
Peter Gottschling is founder of SimuNova, a company that works on developing the Matrix Template Library (MTL4) and offers C++ training. He is a member of the ISO C++ standards committee, vice-chair of Germany s programming language standards committee, and founder of the C++ User Group in Dresden. He earned his Ph.D. in computer science at Technische Universitat Dresden in 2002.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

This talk essentially presents the chapter 5 of "Discovering Modern C++". I remember I loved reading it.

testtest-qmcj
Автор

[20:37] That shouldn't be the case!

From Paragraph 5.16/1 of the C++ 11 Standard:

Conditional expressions group right-to-left. The first expression is contextually converted to bool (Clause 4). It is evaluated and if it is true, the result of the conditional expression is the value of the second expression, otherwise that of the third expression. Only one of the second and third expressions is evaluated. Every value computation and side effect associated with the first expression is sequenced before every value computation and side effect associated with the second or third expression.

tourdesource
Автор

That moment when your saxonian accent is so thick that it leaks into your english so bad...

Ilendir