The C++14 std::exchange is a simple utility that sets the first argument to the provided value and returns the original value. While straightforward, this behaviour greatly simplifies the typical implementation of move-semantics and other use-cases that would otherwise have to rely on temporary variables. Compiler Explorer link: https://lnkd.in/eWg5Guwn #cpp #cplusplus #coding #programming #dailybiteofcpp
Thanks for sharing!
What I am always curious about new (c++14 is not that new, factually) standards- how many directions they cover/extend to. When I want to grasp new features, sometimes it's not so easy to just realize new feature-map set (although cpp reference gives overview /comparisons)