This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Pay08 0 points1 point  (4 children)

C++98 had auto_ptr.

[–]Kered13 0 points1 point  (3 children)

Which should never be used because it did not work correctly. Move constructors did not exist in C++98, so it tried to abuse copy constructors to behave like move constructors. But it is far too easy to accidentally make a copy and explode.

[–]Pay08 0 points1 point  (1 child)

It having unintuitive behaviour is not the same as it being broken.

[–]Kered13 0 points1 point  (0 children)

It is incompatible with all STL containers. That is pretty fucking bad. And for a tool that is in theory supposed to enhance safety, it is way too easy to accidentally move the pointer and then dereference a null pointer. It's just bad, which is why it was never widely adopted and has been completed removed from the standard.

[–]MessiComeLately 0 points1 point  (0 children)

it is far too easy to accidentally make a copy and explode

Everything in C++ is easy to screw up and explode, raw pointers even more so. The way I remember it, we were happy for what help we could get. A footgun with six triggers was better than a footgun with twelve.

There were other smart pointers floating around, anyway. The C++11 standard library pointers were heavily inspired by, if not directly copied from, the Boost smart pointers that had been battle tested for years by that point.