Search code examples
c++visual-studioconstructorintellisensecopy-constructor

Visual Studio Intellisense suddenly shows copy constructor and not parametrized constructor


I don't know what changed, but my VS IntelliSense during C++ coding suddenly started showing a different order of class constructors.

I would expect it would show my defined parametrized constructors first, as it used to, but now there is a copy constructor in the first place and my constructors after that.

A minor hindrance, but now I have to go down the list to find what I need every time.

My Google-fu didn't give me a solution apart from defining the copy constructor and then hiding it from IntelliSense manually.

I found out this behaviour is not solution-specific.

What did I do wrong to achieve this behaviour and how can I change things back to showing parametrized constructor in the first place?

EDIT: What I tried so far (and did not help):

  • restarting Visual Studio
  • deleting .vs folder

Solution

  • Please check if you have modified the code that involves the constructor. The order of constructors defined will affect the order IntelliSense display. Here's a workaround to set your defined parametrized constructors first.

    change the order of constructor defined in your class file. Define the copy constructor in the first place and define parametrized constructors after that. Then you'll see IntelliSense automatically show parametrized constructors in the first place. There seems an inverted order mapping between class constructors and IntelliSense display.

    Note: please make backup before you modify your code.

    For example:

    example

    Hope it can help you.