ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

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

Автор: CppCon

Загружено: 2022-01-11

Просмотров: 70739

Описание: https://cppcon.org/
https://github.com/CppCon/CppCon2021
---
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 compile-time?" We will find this answer by looking at constexpr as a continuum. On one end of the continuum is the use case of moving a runtime fixed-size vector into a compile-time fixed-size constexpr array, and on the far end is executing your entire program at compile-time and simply outputting the results at runtime.

---
Jason Turner

Host of C++Weekly    / jasonturner-lefticus  , Co-host of CppCast http://cppcast.com, Co-creator and maintainer of the embedded scripting language for C++, ChaiScript http://chaiscript.com, and author and curator of the forkable coding standards document http://cppbestpractices.com.

I'm available for contracting and onsite training.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

*--*

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Your New Mental Model of constexpr - Jason Turner - CppCon 2021

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Law of Demeter: A Practical Guide to Loose Coupling - Kris Jusiak - CppCon 2021

Law of Demeter: A Practical Guide to Loose Coupling - Kris Jusiak - CppCon 2021

Back to Basics: Master the static inline, const, and constexpr C++ Keywords - Andreas Fertig

Back to Basics: Master the static inline, const, and constexpr C++ Keywords - Andreas Fertig

Back to Basics: C++ API Design - Jason Turner - CppCon 2022

Back to Basics: C++ API Design - Jason Turner - CppCon 2022

Compiler Explorer: The Features You Never Knew Existed - Matt Godbolt - CppCon 2025

Compiler Explorer: The Features You Never Knew Existed - Matt Godbolt - CppCon 2025

Программа «Статус» с Екатериной Шульман и Максимом Курниковым | 10.02.2026

Программа «Статус» с Екатериной Шульман и Максимом Курниковым | 10.02.2026

Breaking Dependencies: Type Erasure - A Design Analysis - Klaus Iglberger -  CppCon 2021

Breaking Dependencies: Type Erasure - A Design Analysis - Klaus Iglberger - CppCon 2021

Почему ваш код не соответствует Python (и как это исправить)

Почему ваш код не соответствует Python (и как это исправить)

C++ Lambda Idioms - Timur Doumler - CppCon 2022

C++ Lambda Idioms - Timur Doumler - CppCon 2022

Back to Basics: Templates in C++ - Nicolai Josuttis - CppCon 2022

Back to Basics: Templates in C++ - Nicolai Josuttis - CppCon 2022

Искусственный Интеллект изменил МУЗЫКУ навсегда

Искусственный Интеллект изменил МУЗЫКУ навсегда

What you must know before AGI arrives | Carnegie Mellon University Po-Shen Loh

What you must know before AGI arrives | Carnegie Mellon University Po-Shen Loh

Reflection: C++’s Decade-Defining Rocket Engine - Herb Sutter - CppCon 2025

Reflection: C++’s Decade-Defining Rocket Engine - Herb Sutter - CppCon 2025

F94: прямой эфир, философия программиста, вопросы и ответы

F94: прямой эфир, философия программиста, вопросы и ответы

Branchless Programming in C++ - Fedor Pikus - CppCon 2021

Branchless Programming in C++ - Fedor Pikus - CppCon 2021

Почему первые люди на Марсе умрут там – Суровая реальность | документальный фильм

Почему первые люди на Марсе умрут там – Суровая реальность | документальный фильм

Обычный снегопад или катастрофа? Как Нью-Йорк снегом замело.

Обычный снегопад или катастрофа? Как Нью-Йорк снегом замело.

What we did before fridges

What we did before fridges

Back to Basics: Lambdas - Nicolai Josuttis - CppCon 2021

Back to Basics: Lambdas - Nicolai Josuttis - CppCon 2021

Вселенная состоит из информации? Объясняю на пальцах

Вселенная состоит из информации? Объясняю на пальцах

Почему эти 5 растворителей должны быть у каждого

Почему эти 5 растворителей должны быть у каждого

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]