in C++ the = operator is automatically defined when creating a new class but what about the == operator, my professor said that if we didn't write operator== this will cause an error but on the other side we learnt that if we didn't write one the compiler will create one for as which compares each element of the class member using the == operator which matches that element. what is right here?
Asked
Active
Viewed 44 times
0
-
This should be trivially easy for you to test on your own with a few minimal example programs. There's also a *lot* of documentation about this available online and most good text books also cover it. I fail to see why Stackoverflow is your first port of call.. – Jesper Juhl Jun 01 '20 at 17:15
-
Here's a good link for you for the future: https://en.cppreference.com/w/ and another one: https://stackoverflow.com/q/388242/5910058 – Jesper Juhl Jun 01 '20 at 17:18