2 ms·
Yes, the copy-and-swap idiom [1] is the classic "correct" (but somewhat unintuitive) answer to this problem. It was probably not widely known in 1997, though.
by Sharlin 12y ago
Yes, the copy-and-swap idiom [1] is the classic "correct" (but somewhat unintuitive) answer to this problem. It was probably not widely known in 1997, though.
[1] http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom http://stackoverflow.com/questions/3279543/what-is-the-copy-...
- maxlybbert 12y agoAccording to the article, correctly implementing copy assignment wasn't widely known either.