user2223730
user2223730

Reputation: 31

No intellisense with direct-initialization syntax in Visual Studio 2013

When I type

Widget w = Widget(

intellisense automatically give a popup where I can navigate through the available constructors. Where as if I type

Widget w(

I get no such popup. Nor does the shortcut(Ctrl+Shift+Space) bring it up. I tried resetting my settings but it didn't help. Anyone know if this behavior is intended or if it's fixable?

Upvotes: 2

Views: 151

Answers (1)

Arne Mertz
Arne Mertz

Reputation: 24626

Widget w(... could be the start of different things. e.g. the definition of an object named w (which seems to be what you want), but also a declaration of a function called w, returning a Widget. That might be a reason for intellisense to refuse to work.

For C++11 (which is supported by VS2013 IIRC) you could try uniform initialization as well:

Widget w{...

or even the new "auto" style proposed by Herb Sutter and others:

auto w = Widget{...

Upvotes: 1

Related Questions