0

If I have a class called Connection for which I have defined both the copy constructor and the assignment operator=.

When I write the code Request r2 = r1; (where r1 has been defined through the constructor: Connection r1), am I calling the copy constructor or the assignment operator=?

Fabio
  • 61
  • 5
  • 1
    Copy constructor. – yeputons Jul 06 '22 at 16:57
  • You are calling neither of the two. You are using some constructor or conversion function, not an assignment operator, but it is (likely) not the copy constructor, because `Request` is a different type than `Connection`. Please provide a complete [mre]. – user17732522 Jul 06 '22 at 17:00

0 Answers0