fork download
  1. #include <memory>
  2. #include <typeinfo>
  3. #include <iostream>
  4.  
  5. auto foo()
  6. {
  7. auto type = [] (void*) {};
  8. return std::unique_ptr<void, decltype (type)> { nullptr, type };
  9. }
  10.  
  11. int main()
  12. {
  13. std::cout << typeid (foo ()).name () << std::endl;
  14. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
St10unique_ptrIvZ3foovEUlPvE_E