Discussion Locked

Benefit from default assignment operator

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
The Dec. 2, C++ TechMail discusses implementation of number-like classes in your C++ applications? Will this tip on using a default implementation of assignment operators help your future application development?

2 replies

by spi

This is, up to me, typically the kind of stuff NOT TO USE in real world developpment.
It's hard to maintain and the resulting "magic" is very hard to understand for newcomers.

by john torjo

Hi,

While I respect your point of view, as I said at the beginning of this tip, this is meant for number-like classes. When implementing such a class, you'll definitely want to overload operators +, -, +=, etc.

If you are developing such a number-like class, you should know what you're doing ;-)
All I wanted was to allow automating the process as much as possible.

You can therefore benefit from these operators.

Best,
John

This discussion is closed to new replies.