Wednesday 

Room 4 

10:20 - 11:20 

(UTC+02

Talk (60 min)

How to declare a constant in C++

C++ is beautiful in the way that even the simplest things can be unexpectedly challenging and complex. You’d think that nothing could be easier than declaring a constant, right? Choose the most suitable way to define it: a global variable, a local variable, or a static class data member. Maybe a reference. Maybe a template. Set the right linkage and storage duration. Use some combination of specifiers like static, inline, and constexpr for that. Maybe use extern in some cases. How does it play along with module export by the way?.. Oh, and if it's a string, pick the proper type: const char*, char[], std::string, or std::string_view, each of which have their own pros and cons. If all of this is obvious to you — congratulations! That’s impressive. But if, like Mikhail, this whole zoo makes your head spin a bit, let’s try to untangle it together.

Mikhail Matrosov

Mikhail is a seasoned C++ developer with over 15 years of experience across various domains. He is currently designing and implementing a high-frequency trading system at Pinely using cutting-edge technologies. Previously, he developed a 3D CAD system for orthodontic aligners at Align Technology and worked on image processing and computer vision at Moscow State University.

A frequent speaker at conferences including CppCon, using std::cpp, emBO++, C++ Russia and more, Mikhail co-authored the popular course "Fundamentals of C++ Development" with Yandex. He has also taught at the Faculty of Computer Science at the Higher School of Economics in Moscow.