logoalt Hacker News

tialaramexyesterday at 6:59 PM1 replyview on HN

I actually don't know (at least I don't think I do) the full story here, can you elaborate?


Replies

eskayesterday at 7:08 PM

auto_ptr was so misdesigned, they erased it from the language in a later standard. The problem was that the assignment operator “T x = y;” is supposed to have copy semantics, but auto_ptr gave it move semantics by overwriting the source to destroy that reference. This broke all sorts of code that rightfully assumed assignment is done by copying. Therefore all kinda of algorithms like sort broke, as well as resource management. Suffice to say I am personally not a fan of C++ language design or Stroustrup’s opinions on programming.

show 3 replies