-4

Can any one please let me know whether we can declare static variables inside an inline function and if we can how it is going to work between function calls.

kadina
  • 5,042
  • 4
  • 42
  • 83

1 Answers1

1

Yes you can, and they should* behave exactly the same as for a non-inline static local.

* Visual Studio 6 (yes, that ancient compiler) has a bug where if the inline function gets both inlined and non-inlined in different translation units the local will get constructed twice.

Mark B
  • 95,107
  • 10
  • 109
  • 188