Hi Blink devs,Yes, yes, you probably remember my name already...This time I'm going to rename OwnPtr::clear() to reset(), so it matches the name of std::unique_ptr's equivalent. Unless I receive objections, I will make this change sometime tomorrow in Japan time (in 20 hours or so).This is supposed to be the last update in OwnPtr. The next update will be the complete removal of OwnPtr, which consists of the following changes applied in the whole code base at once:
- Rename OwnPtr and PassOwnPtr to std::unique_ptr,
- Rename leakPtr() to release(), and
- Rename adoptPtr() to wrapUnique().
Should we do something smart here to convertOwnPtr<Foo> foo = adoptPtr(new Foo());intostd::unique_ptr<Foo> foo(new Foo());?
I recommend blocking the removal of OwnPtr on making it a typedef of std::unique_ptr (you'll need to use `using` as it's a templated class).
On Mon, May 30, 2016 at 2:44 PM, Alan Cutter <alanc...@chromium.org> wrote:I recommend blocking the removal of OwnPtr on making it a typedef of std::unique_ptr (you'll need to use `using` as it's a templated class).The biggest concern I have is that MSVC still can't handle template alias gracefully. I saw some internal compiler errors on MSVC 2015 caused by the use of template alias.
Another (smaller) reason of not typedef'ing is that it can be confusing to add OwnPtr::release() which is identical to std::unique_ptr::release(), as OwnPtr::release() had the different semantics previously.
On Mon, May 30, 2016 at 12:21 AM Yuta Kitamura <yu...@chromium.org> wrote:On Mon, May 30, 2016 at 2:44 PM, Alan Cutter <alanc...@chromium.org> wrote:I recommend blocking the removal of OwnPtr on making it a typedef of std::unique_ptr (you'll need to use `using` as it's a templated class).The biggest concern I have is that MSVC still can't handle template alias gracefully. I saw some internal compiler errors on MSVC 2015 caused by the use of template alias.For simpler templates like OwnPtr, it shouldn't be a problem. That's what we did for scoped_ptr and there were no issues on the bots.
Another (smaller) reason of not typedef'ing is that it can be confusing to add OwnPtr::release() which is identical to std::unique_ptr::release(), as OwnPtr::release() had the different semantics previously.Once using a type alias is possible, it's trivial to do a mass sed to finish up the work. The transition period will be pretty short, and Blink developers are going to have to get used to the different semantics of std::unique_ptr::release() either way.