CppCon 2017: Ben Deane & Jason Turner “constexpr ALL the Things!”

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


constexpr: in C++11, a curiosity; in C++14, viable for more uses; now with added power, in C++17 will it become an important tool in the programmer's toolkit?

In this talk we will examine the possibilities and power of constexpr and explore what can (and what should) be done at compile-time with C++17. We'll present techniques for building constexpr data structures and algorithms, and look at what the standard provides and where it can improve. We'll also explore constexpr use of user defined literals for expressive compile-time abstractions.

Compile-time computation offers perhaps the ultimate zero-cost abstraction, and this talk attempts to gauge the power available with C++17 constexpr.

Ben Deane: Principal Software Engineer, Blizzard Entertainment

Jason Turner: Developer, Trainer, Speaker

I'm available for contracting and onsite training.


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

"There was a misunderstanding between me and the compiler".

henke
Автор

Great talk by Ben and JSON, as always!

jankodedic
Автор

Just when I thought I had a grip on C++ … well done, guys. ((slow-clap))

dipi
Автор

"Jason" just talked about how we actually represent "Jason" values

arthur.passos
Автор

I’ve done all of SHA2 in constexpr, and I’ve even written a program that Randomly decides when it wants to compile.

connorhorman
Автор

wow, this really is constexpr all the things

cc.jsullivan
Автор

Great talk by Bean and Freddie, as is the norm.
I don't know whats going on either. I just try to fit in.

prezadent
Автор

"constexpra" tripped me up every time

JosefdeJoanelli
Автор

great talk by deane and jason, as always !

hanneshauptmann
Автор

"You can clearly see..." -> No I can not, lol
Nonetheless, awesome

OperationDarkside
Автор

The code on slide 20 (at 12:20) is not part of the github project and doesn't seem to compile.. Nothing of cx_map.h seems to be used in the project. When I comment all its content out and remove its import into cx_json_value.h, the project still compiles?! Whenever I try to use cx::map, it gives an error "no type named 'type' in 'struct std::enable_if<false, int>'". (Tried with GCC 7.2.0 as they claimed to use - concrete distribution: MinGW-w64

xamidi
Автор

33:45 Isn't that essentially zipWith in haskell?

alcesmir
Автор

Wtf are those comments on every vid ;o

outsiderst
Автор

Next stop, Lua constexpr implementation.

connorhorman
Автор

Did anyone else catch The Prisoner reference at 51:38?

intvnut
Автор

bit disappointing to see old Jason video in new clothes. Where I can see the source code of this?

nmmm
Автор

OK, this is just a fun thing to do isn't it (and interesting), but totally impractical. Would be faster/better to write a simple console app to parse json into a C++ structure, running it as a pre-build step.

robbie_
Автор

It's very impressive, but honestly? a) You can't debug it properly, really, and thus it's VERY hard to use in an environment with multiple people having to be able to read and understand the code, and b) as soon as your code base grows past a few 100k loc this "bit of compile time overhead" will drive everyone insane (if we assume a relatively constant percentage of constexpr code to runtime code). It's nice to speed up your runtime side, but if every recompile takes (literally!) hours, you can't work on the code base productively anymore.

Runoratsu
Автор

It's out of topic but why always guys??
I want to see more women on the stage any more especially in this discipline.

By the way, congrats guys, great talk :)

simgesonmez