I have a survey that a sizable proportion of my customers fill out. Right now, 10.6.8 is used by 1.53% of my users. To put things in perspective, OSX is about 70% of my users, and Windows is at 30%.
XP is at 0.51% of my users, if anyone cares, and Vista is at 0.08%.
This will be a nightmare for me… my projects make heavy use of ScopedPointer, so unless I write my own wrapper class I can see much unforeseen code maintenance on the horizon
Like I said above, we won’t remove ScopedPointer any time soon. We’ll stop using it ourselves and encourage you to stop too, but there’d be no sense in breaking anyone’s builds by removing it.
Since removing 10.6 support Atomic is just a thin wrapper around std::atomic anyway. Using the latter directly gives you much more control over how you interact with C++'s memory model.
Is there any way for you guys to just add the features ScopedPointer is missing that std::unique_ptr has? std::unique_ptr’s usage pattern is just ugly:
addAndMakeVisible( mySpecialObjectInAScopedPointer = new SpecialObject(params) );
vs.
addAndMakeVisible( *(mySpecialObjectAsAUniquePtr = std::make_unique<SpecialObject>(params)) );
I get that you guys wrote ScopedPointer back when std c++ didn’t have a lot of tools, but as a few other people have mentioned in this thread, it’s often easier to use than std::unique_ptr<>.
What all can std::unique_ptr<> do that ScopedPointer can’t?
The good thing about std::unique_ptr is that it deliberately isn’t as easy to use as ScopedPointer, and that stops people making mistakes with it.
Obviously feel free to carry on using ScopedPointer if you want to - we won’t remove it any time soon. But the C++ committee put a lot of thought into the design of unique_ptr, and we recommend that you use it if you can.
Yes, there’s really not that much difference in the syntax and I’ve personally been saved several times by using the the std smart pointers. As Jules says, they just don’t allow you to do dangerous things.