Lightning Talk: Help! My Expression Template Type Names Are Too Long! - Braden Ganetsky CppCon 2023
Вставка
- Опубліковано 14 кві 2024
- cppcon.org/
---
Lightning Talk: Help! My Expression Template Type Names Are Too Long! - Braden Ganetsky - CppCon 2023
github.com/CppCon/CppCon2023
Even the name of this talk is too long! If we're ever working with expression templates, we can easily make type names long enough to slow down compilation time. Suddenly our "zero-overhead" expression templates start giving a large compile time overhead. I'll show off a C++20 trick to fix this problem.
---
Braden Ganetsky
Braden Ganetsky graduated from the University of Manitoba with a degree in mechanical engineering, but soon pivoted to C++. Now he spends his days working on supply chain simulation software, and spends his nights working on parser combinators and getting involved in the C++ community.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
UA-cam Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp - Наука та технологія
That parsing library is incredible I wanna use it rn
This is so stupid. And I love it!
I'd love to know all the tricks about this, too.
Crossplatform prefferered.
Interesting find
Nice video
Template type names are actually weird in C++. I just used std::map but when it hit an error, the compiler also showed me the default typename of that std::map and that took me a couple minutes to figure out what happended 😂
Doesn't mputz/mp-units use a trick with the same objective to keep the names of the type quantities short?
Isn't metaprogramming with concepts and variadic templates instead of SFINAE and traditional templating supposed to fix that issue or at least contribute to doing so?
Why not make a template Add{} and implement operator+ such that the whole sum will result in one Add instantiation? Do I miss a point here?
operator+ is a binary operation.
why only msvc tho ?🙄
But now the question: why make all that a giant pile of templates?
I'm not an expert but maybe the Wikipedia article for expression templates can explain that
Because we can 😅
Why make expression templates a bunch of templates? Good question.
The parsing lib he showed in the beginning was a very good example of why this would happen. I have a similar case for a stream/pipeline library. I can also see this happen with composable allocators as described in andrej alexandrescu's talk about allocators from a couple of years ago.
Bacause C++ is a steaming pile of hot garbage
Thumbs up for joy!