std::make_shared() change in C++17
问题 In cppref, the following holds until C++17: code such as f(std::shared_ptr<int>(new int(42)), g()) can cause a memory leak if g gets called after new int(42) and throws an exception, while f(std::make_shared<int>(42), g()) is safe, since two function calls are never interleaved. I'm wondering which change introduced in C++17 renders this no longer applicable. 回答1: The evaluation order of function arguments are changed by P0400R0. Before the change, evaluation of function arguments are