Generics in C++ 8 - Template Classes with Static Data Members | Modern Cpp Series Ep. 78

preview_player
Показать описание

►Lesson Description: In this lesson we continue looking at class templates, this time adding in the static member variable. We'll look at how the compiler generates one copy of a static variable for each template, and how to properly setup a static member variable.

►Please like and subscribe to help the channel!
Рекомендации по теме
Комментарии
Автор

Wonderfully explained as always. Thank you.

dhanushs
Автор

Great explanation.
It seems this can be done with an inline static member under c++17.

diodin
Автор

In C++17, by inlining m_variable inside the class template, the external definition becomes unnecessary.

mingxue