I have some confusion with this \"Can a object be passed as value to the copy constructor\" The compiler clearly rejects this, which means it is not possible. Can you help m
Though the answer was already given, I just wanted to clarify, since I see the same questions repeated.
Dummy(Dummy dummy);
is not a copy constructor. Copy constructor can either be of form Dummy(const Dummy&);
or Dummy(Dummy&);
The original one is clearly prohibited by the Standard.
Then you are asking:
Then why is it said that "Copy constructor will lead to recursive calls when pass by value is used."
Diagnostic message is not mandated by the standard, rather your compiler chose those words to explain why it couldn't possibly work.