Myvideo

Guest

Login

Your New Mental Model of constexpr - Jason Turner - CppCon 2021

Uploaded By: Myvideo
1 view
0
0 votes
0

--- In my experience as a trainer, YouTuber, and speaker, I find that many people have a mistaken impression of what constexpr is and for what it is suited. I see people over-complicate constexpr by conflating it with meta programming and template-related topics. Students will often fail to recognize where and when constexpr could be used. Experts will get concerned about the “contract“ you are making with the user of your library by marking functions as constexpr. In this talk, I will present a mental model for how you should consider constexpr. I will explain what constexpr is (less mechanically and more metaphorically), give practical applications for constexpr, and help you figure out where constexpr fits into your application or library. In the most straightforward sense, constexpr is moving work from runtime to compile-time. This mental model that I will present will ask, “what work would you rather do at comp

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later