Популярное

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

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

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

Топ запросов

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

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

Автор: CppCon

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

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

Описание:

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

*--*

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

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

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

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

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

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

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

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

Как разрабатывать приложения с использованием C++20 coroutines, Константин Вуколов

Как разрабатывать приложения с использованием C++20 coroutines, Константин Вуколов

How To Use `constexpr` In C++23 - Jason Turner - NDC TechTown 2024

How To Use `constexpr` In C++23 - Jason Turner - NDC TechTown 2024

Михаил Матросов — Как объявить константу в С++?

Михаил Матросов — Как объявить константу в С++?

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

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

C++ Code Smells - Jason Turner - CppCon 2019

C++ Code Smells - Jason Turner - CppCon 2019

Keynote: The Real Problem of C++ - Klaus Iglberger

Keynote: The Real Problem of C++ - Klaus Iglberger

Введение в constexpr | Серия Modern Cpp, выпуск 86

Введение в constexpr | Серия Modern Cpp, выпуск 86

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

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

Rethink Polymorphism in C++ - Nicolai Josuttis - C++ on Sea 2025

Rethink Polymorphism in C++ - Nicolai Josuttis - C++ on Sea 2025

C++ Lambda Idioms - Timur Doumler - CppCon 2022

C++ Lambda Idioms - Timur Doumler - CppCon 2022

Дефицит памяти уже достал. Был ли сговор? Когда все подешевеет? И при чем тут NVIDIA?

Дефицит памяти уже достал. Был ли сговор? Когда все подешевеет? И при чем тут NVIDIA?

“Constexpr Everything” - The Standard Library, Microkernel, Apps, and Unit Tests - Rian Quinn

“Constexpr Everything” - The Standard Library, Microkernel, Apps, and Unit Tests - Rian Quinn

Declarative Style Evolved - Declarative Structure - Ben Deane - C++Now 2025

Declarative Style Evolved - Declarative Structure - Ben Deane - C++Now 2025

Информационная инфляция: конец эпохи знаний

Информационная инфляция: конец эпохи знаний

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

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

Цепи Маркова — математика предсказаний [Veritasium]

Цепи Маркова — математика предсказаний [Veritasium]

Closing Keynote: C++ as a 21st century language - Bjarne Stroustrup

Closing Keynote: C++ as a 21st century language - Bjarne Stroustrup

Implementing static_vector: How Hard Could it Be? - David Stone - CppCon 2021

Implementing static_vector: How Hard Could it Be? - David Stone - CppCon 2021

Как удивить себя аккордом [Теория музыки по-пацански]

Как удивить себя аккордом [Теория музыки по-пацански]

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



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



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