Separate declaration and definition for C++ templates? Yes please (sometimes)

preview_player
Показать описание
It seems that the topic of compiling templated code in C++ into libraries is one of the typical contention topics for lots of people when they use templates in their code. In this video we look into why this topic can be perceived as such a complex one as well as how we can actually achieve what we want.

🔗 *Links*
Рекомендации по теме
Комментарии
Автор

Thanks a lot for watching, folks! Don't forget to share any thoughts you might have on this (or anything else)! 🙏

CodeForYourself
Автор

I am new to C++ templates and ran into this exact issue about an hour ago. This video helped me a lot, thanks!

BISONBOT
Автор

Amazing video and visuals! what do you use to create them?

Sara_
Автор

If I'm not mistaken, this only helps speeding up compilation times due to the explicit template specialisation. Still, what other benefits do I get by splitting template declarations and definitions?

SystemSigma_
Автор

I wonder how the templates are used in data structures in STL (for ex: vector) so that it not only works with primitive data types like int, float, etc. (for which can do the template specialization) but also with user defined classes/structs, which is not known before hand.

Any ideas ? @CodeForYourself

UvUtkarsh