#include struct A { void f() {} }; void foo() { std::unique_ptr ptr = std::make_unique(); ptr.get()->f(); }