News for hackers. Stuff that matters.
Re:C++17 Library Papers for Cologne by TillE on Saturday February 14, 2015 @12:44PM (#9050184)
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.
Re:C++17 Library Papers for Cologne by StephanTLavavej on Saturday February 14, 2015 @01:11PM (#9050267)
My erase_if proposal was accepted for the Library Fundamentals v2 Technical Specification and is therefore likely to get into C++17.
Re:C++17 Library Papers for Cologne by jgh on Saturday February 14, 2015 @12:57PM (#9050216)
That's definitely a nice addition. I also like the map::try_emplace and map::insert_or_assign suggestions.
Re:C++17 Library Papers for Cologne by Lich on Saturday February 14, 2015 @12:02PM (#9050083)
I'm so behind on my C++ knowledge. I haven't even read up on smart pointers yet.
Re:C++17 Library Papers for Cologne by static_noise on Sunday February 15, 2015 @04:21AM (#9052139)
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.
Re:C++17 Library Papers for Cologne by blt on Saturday February 14, 2015 @02:36PM (#9050536)
Where is the Ranges proposal?
Re:C++17 Library Papers for Cologne by meetingcpp on Saturday February 14, 2015 @04:20PM (#9050825)
Eric Niebler is still working on it, see his last blogposts at http://ericniebler.com
Re:C++17 Library Papers for Cologne by kryptiskt on Saturday February 14, 2015 @03:42PM (#9050730)
On https://isocpp.org/blog/2015/02/2015-02-mid-meeting-mailing-... it says "missing", I hope that they find it.