KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Does the compiler generated assignment operator guard against self assignment? class T { int x; public: T(int X = 0): x(X) {} }; int main() { T a(1); a = a; } Do I always need to protect against self-assignment even when the class members aren't of pointer type?
Tags (comma-separated)
Save Edits
Cancel