> the destructor call of the p1.
>
>
You know, perhaps it already does that?
Here is the result on MSVC 2017:
#include <memory>
int main()
{
00007FF7893D1000 sub rsp,28h
std::unique_ptr<int> p1 = std::make_unique<int>();
00007FF7893D1004 mov ecx,4
00007FF7893D1009 call operator new (07FF7893D1024h)
00007FF7893D100E xor ecx,ecx
00007FF7893D1010 mov dword ptr [rax],ecx
std::unique_ptr<int> p2;
p2 = std::move(p1);
}
00007FF7893D1012 lea edx,[rcx+4]
00007FF7893D1015 mov rcx,rax
00007FF7893D1018 call operator delete (07FF7893D1060h)
00007FF7893D101D xor eax,eax
00007FF7893D101F add rsp,28h
00007FF7893D1023 ret
What destructor call do you want to remove?
Bo Persson