Can an inline variable be changed after initialization in C++17?
问题 My scenario is the following (it worked in clang but not in gcc) liba.hpp: inline int MY_GLOBAL = 0; libother.cpp: (dll) #include "myliba.hpp" void myFunc() { // MYGLOBAL = 28; } someexe.cpp: RunAppThatUsesBothLibAandLibOther(); The problem is that the inline variable was showing 0 in places where I expected 28 because it was alrady modified at run-time. MSVC disagrees with this, but clang does the thing I would expect. The question is: can inline variables be modified at run-time in my