Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does IntelliSense show a constructor I didn't write?

What does it mean by the suggestion give by the IDE? (using VS 2010)

enter image description here

There is no constructor of baseClass_2 which takes the suggested parameter(const baseClass_2 &). So, why this is showing up?

like image 823
Quazi Irfan Avatar asked Jun 18 '11 18:06

Quazi Irfan


1 Answers

Implicitly defined copy constructor.

There are special member functions which get defined by default when you not explicitly declare / define them:

  • Default constructor
  • Copy constructor
  • Destructor

Note that the default constructor will not get defined when you provide any other constructor besides the copy constructor.

like image 130
Xeo Avatar answered Oct 13 '22 21:10

Xeo