5 ms·
C++17 Library Papers for Cologne
- Lich 12y agoI'm so behind on my C++ knowledge. I haven't even read up on smart pointers yet.
- deleted 12y ago[deleted]
- static_noise 12y agoSmart pointers are pretty easy to use. They basically just delete the object they are pointing to if they go out of scope. You never have to worry about when and where to write "delete" again. What if an exception occurs in your code? No worry, the smart pointer deletes the object. If you use a "shared pointer" you can duplicate the pointerand use it in other functions and classes - the deletion happens when the last pointer object goes out of scope. Example: { auto a = shared_ptr<T>( new T() ); } // Now it gets deleted. Another one: { auto a = shared_ptr<T>( new T() ); some_object.the_shared_ptr = a; another_object.the_shared_ptr = a; } // Not yet, wait for the copies to get deleted.
- TillE 12y agoerase_if sounds like a method I'd be happy to have in many languages, where containers aren't safe to modify as you're iterating over them.
- jgh 12y agoThat's definitely a nice addition. I also like the map::try_emplace and map::insert_or_assign suggestions.
- StephanTLavavej 12y agoMy erase_if proposal was accepted for the Library Fundamentals v2 Technical Specification and is therefore likely to get into C++17.
- blt 12y agoWhere is the Ranges proposal?
- kryptiskt 12y agoOn https://isocpp.org/blog/2015/02/2015-02-mid-meeting-mailing-available https://isocpp.org/blog/2015/02/2015-02-mid-meeting-mailing-... it says "missing", I hope that they find it.
- meetingcpp 12y agoEric Niebler is still working on it, see his last blogposts at http://ericniebler.com http://ericniebler.com