Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
C++17 Library Papers for Cologne (meetingcpp.com)
32 points by meetingcpp on Feb 14, 2015 | hide | past | favorite | 8 comments


erase_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.


My erase_if proposal was accepted for the Library Fundamentals v2 Technical Specification and is therefore likely to get into C++17.


That's definitely a nice addition. I also like the map::try_emplace and map::insert_or_assign suggestions.


I'm so behind on my C++ knowledge. I haven't even read up on smart pointers yet.


Smart 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.


Where is the Ranges proposal?


Eric Niebler is still working on it, see his last blogposts at http://ericniebler.com


On https://isocpp.org/blog/2015/02/2015-02-mid-meeting-mailing-... it says "missing", I hope that they find it.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: