Тёмный

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

CppCon
Подписаться 149 тыс.
Просмотров 56 тыс.
0% 0

CppCon.org
-
Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2017
-
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
Ben has been writing games for almost 20 years, and in C++ for most of that. He is currently a Principal Engineer at Blizzard Entertainment where he works on the Battle.net team. He's always looking for useful new techniques in C++, and he likes functional programming.
Jason Turner: Developer, Trainer, Speaker
Host of C++Weekly / jasonturner-lefticus , Co-host of CppCast cppcast.com, Co-creator and maintainer of the embedded scripting language for C++, ChaiScript chaiscript.com, and author and curator of the forkable coding standards document cppbestpractices.com.
I'm available for contracting and onsite training.
-
Videos Filmed & Edited by Bash Films: www.BashFilms.com
*-----*
Register Now For CppCon 2022: cppcon.org/registration/
*-----*

Опубликовано:

 

27 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@henke37
@henke37 6 лет назад
"There was a misunderstanding between me and the compiler".
@meow75714
@meow75714 2 года назад
How polite of him to address Mr. Compiler like that. For rest of us compiler is a real bitch.
@jankodedic3130
@jankodedic3130 6 лет назад
Great talk by Ben and JSON, as always!
@ruadeil_zabelin
@ruadeil_zabelin 6 лет назад
Json hahahaha
@dipi71
@dipi71 6 лет назад
Just when I thought I had a grip on C++ … well done, guys. ((slow-clap))
@OperationDarkside
@OperationDarkside 6 лет назад
Kinda rethorical question: Do you ever?
@WorldWideWebWisdom
@WorldWideWebWisdom 2 года назад
@@OperationDarkside 3 years later, I can confidently tell you that you never do.
@arthur.passos
@arthur.passos 5 лет назад
"Jason" just talked about how we actually represent "Jason" values
@hanneshauptmann
@hanneshauptmann 6 лет назад
great talk by deane and jason, as always !
@odedkadshai
@odedkadshai 4 года назад
a milestone lecture. well done!
@cc.jsullivan
@cc.jsullivan 6 лет назад
wow, this really is constexpr all the things
@connorhorman
@connorhorman 5 лет назад
I’ve done all of SHA2 in constexpr, and I’ve even written a program that Randomly decides when it wants to compile.
@prezadent1
@prezadent1 6 лет назад
Great talk by Bean and Freddie, as is the norm. I don't know whats going on either. I just try to fit in.
@JosefdeJoanelli
@JosefdeJoanelli 3 года назад
"constexpra" tripped me up every time
@TheMR-777
@TheMR-777 2 года назад
@Mercer “constant expression” can be any constant expression “constexpr” is a 'term', which also mean functions, and methods, which evaluate on compile time
@OperationDarkside
@OperationDarkside 6 лет назад
"You can clearly see..." -> No I can not, lol Nonetheless, awesome
@AM-qx3bq
@AM-qx3bq 4 года назад
That's functional syntax for parsing a string key to the value of your reaction. Nice.
@bsuperbrain
@bsuperbrain 6 лет назад
Is this the same talk from 2016?
@xamidi
@xamidi 3 года назад
The code on slide 20 (at <a href="#" class="seekto" data-time="740">12:20</a>) 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'". (Tried with GCC 7.2.0 as they claimed to use - concrete distribution: MinGW-w64 x86_64-7.2.0-release-posix-seh-rt_v5-rev1.)
@yomoma6692
@yomoma6692 6 лет назад
So much usefull knawledge. :D
@alcesmir
@alcesmir 5 лет назад
<a href="#" class="seekto" data-time="2025">33:45</a> Isn't that essentially zipWith in haskell?
@intvnut
@intvnut 6 лет назад
Did anyone else catch The Prisoner reference at <a href="#" class="seekto" data-time="3098">51:38</a>?
@outsider1st
@outsider1st 6 лет назад
Wtf are those comments on every vid ;o
@aDifferentJT
@aDifferentJT 3 года назад
combine is liftA2
@connorhorman
@connorhorman 5 лет назад
Next stop, Lua constexpr implementation.
@nmmm2000
@nmmm2000 6 лет назад
bit disappointing to see old Jason video in new clothes. Where I can see the source code of this?
@robbie_
@robbie_ 6 лет назад
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.
@homomorphic
@homomorphic 5 лет назад
Nope, this isn't just a fun thing to do, it is extremely useful. As is obvious from the talk constexpr still isn't quite ready for prime-time, but when it is it will be extremely useful. It looks like it is getting close, I am guessing that by C++20 it will dripping with awesomeness.
@TheFlynCow
@TheFlynCow 5 лет назад
minimizing the steps and dependencies of your build system is key.
@zes3813
@zes3813 2 года назад
no such thing as expressionx or constexpr or hotexamples ubiquitox or etc, ts just machine, no nerdx or expx or hot about it, cepitxuxyuax, say, can say infix any nmw and any s perfect
@Runoratsu
@Runoratsu 6 лет назад
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.
@homomorphic
@homomorphic 5 лет назад
What in this video leads you to believe that this would substantially increase compile time? I think that Ben and Jason made the point that other than debug builds (which is likely due to symbol emission) that compile time and compile time memory usage are not significantly impacted.
@VioletGiraffe
@VioletGiraffe 5 лет назад
100k LOC doesn't nearly take an hour, though. More like 2.5 minutes for a full recompile (which you should only need very rarely). /DEBUG:FASTLINK will give you much better productivity than reducing code complexity in the interest of compilation time.
@simgesonmez3508
@simgesonmez3508 3 года назад
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 :)
@muhdiversity7409
@muhdiversity7409 5 месяцев назад
Why don't you start? Who exactly is stopping you?
Далее
CppCon 2018: Jason Turner “Applied Best Practices”
1:03:19
Keynote: Optimizing for Change - Ben Deane - CppNorth 2023
1:24:24
это самое вкусное блюдо
00:12
Просмотров 2,1 млн
Игровой Комп с Авито за 4500р
01:00
CppCon 2017: Jason Turner “Practical C++17”
1:00:49
CppCon 2019: Jason Turner “The Best Parts of C++"
58:36
CppCon 2015: Sean Parent "Better Code: Data Structures"
1:04:00