I'm able to pass a std::unique_ptr
rvalue as a parameter to a function like below because of copy elision. Is the copy guaranteed to be elided by the C++11 standard or can this fail to compile on some implementations?
void take_unique_ptr_by_value(std::unique_ptr<int> sp) {
cout << "Value is " << *sp.get() << std::endl;
}
// I am able to call the function above like this:
take_unique_ptr_by_value(std::make_unique<int>(3));