4 ms·You could use; auto* p2 = std::exchange( p1, nullptr );by clappski 7y agoYou could use; auto* p2 = std::exchange( p1, nullptr );