c++ - how to declare a static variable inside an inline function? -


this question has answer here:

can 1 please let me know whether can declare static variables inside inline function , if can how going work between function calls.

yes can, , should* behave same non-inline static local.

* visual studio 6 (yes, ancient compiler) has bug if inline function gets both inlined , non-inlined in different translation units local constructed twice.


Comments