在此代码中:
void f(std::unique_ptr<int> q) { } void g() { std::unique_ptr<int> p{new int{42}}; f(std::move(p)); }
p分配在哪一行?我想在f函数的出口处说一下,因为它是使用std :: move移到那里的,但是我不确定对此答案也不确定。
c++ memory-management smart-pointers unique-ptr c++11
c++ ×1
c++11 ×1
memory-management ×1
smart-pointers ×1
unique-ptr ×1