Tim Buchholz
Tim Buchholz

Reputation: 83

Using inline variables in visual studio

I am currently using Visual Studio 2017 Community Edition and I tried to declare this in my header file:

inline static int counter{1};

Now VS underlines it red and tells me that 'inline' can only be used for functions, although it should be possible since C++17.

Is there a way to still use it in VS or do I have to work around?

Upvotes: 1

Views: 1311

Answers (1)

NathanOliver
NathanOliver

Reputation: 180660

As of Nov. 15, 2017, inline variables are scheduled to be supported in Visual Studio 15.5. You can see the "current" status of features here or here .

Upvotes: 2

Related Questions