No instance of the constructor matches the argument list

I have a problem with Intellisense

on Visual Studio 2010

.

Intellisense

does not offer arguments for class constructors. Although it works great with class methods.

class Window
{
    private:

        WindowImpl *Impl;

    public:

        static unsigned int WindowCount;

        Window();

        Window(unsigned int width, unsigned int height, const std::string &title, int x, int y, unsigned int style);

        void Create(unsigned int width, unsigned int height, const std::string &title, int x, int y, unsigned int style);

        ~Window();

        void Destroy();
};

      

Error: no constructor instance matches argument list

Window mainWindow(100, 200 ...

      

Works fine

mainWindow.Create(100, 200 ...

      

Compilation error, but Intellisense

doesn't show (suggest) arguments for the constructor and shows this error.


I realized that the problem exists with all classes. Hopefully the screenshot will help you understand what I mean. I've tried Visual Assist X

and it doesn't help. Thanks in advance.

+3


source to share


1 answer


I tested your example in VS 2010 and Intellisense works great for both lines. Note that if the function is overloaded, IntelliSense shows the first option and you can click the up / down arrows to see others. enter image description here

IntelliSense is known to sometimes get stuck rather than indexing some classes or showing incorrect results. In such case, you can close the project and delete the intellisense database. When you open a project again, it is built from scratch, hopefully with great success.



Also, if you write a lot of C ++ in VS, consider using Visual Assist X, which replaces many of the IntelliSense features but performs much better. (I'm not affiliated with Tomato Software, just in love with the tool.)

+2


source







All Articles