logoalt Hacker News

eskayesterday at 6:50 PM2 repliesview on HN

Strange to see std::sort(), auto_ptr and RAII on the same page, when that combination was always broken.


Replies

tialaramexyesterday at 6:59 PM

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

show 1 reply
usefulcatyesterday at 8:41 PM

auto_ptr is not used in the example that uses sort(), so "on the same page" is doing a bit of lifting here.

He's using auto_ptr to demonstrate RAII, which is fine. I would assume that the use of auto_ptr indicates that the example was written some time ago.