fork(1) download
  1. #include <memory>
  2.  
  3. template<typename T, typename... Args>
  4. std::unique_ptr<T> my_unique(Args&&... args)
  5. {
  6. return std::unique_ptr<T>(new T{std::forward<Args>(args)...});
  7. }
  8.  
  9. struct point { int x, z; };
  10. int main() { my_unique<point>(1, 2); }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty