I've just started looking into move semantics and Rvalue references so I am learning as I go along, I was wondering whether a call to std::forward
is needed when passing an Rvalue function parameter into a smart pointer?
void CreateUniquePtr(int&& value)
{
std::unique_ptr<int> ptr = std::make_unique<int>(std::forward<int>(value));
}
vs
void CreateUniquePtr(int&& value)
{
std::unique_ptr<int> ptr = std::make_unique<int>(value);
}