fork(6) download
  1. template <typename T>
  2. auto make_obj(T t);
  3.  
  4. template <typename T>
  5. class Obj {
  6. private:
  7. T & t;
  8. Obj (T & t) : t(t) { }
  9. Obj() = delete;
  10.  
  11. friend auto make_obj<T>(T t);
  12. };
  13.  
  14. template <typename T>
  15. auto make_obj(T t) {
  16. return Obj<T>{t};
  17. }
  18.  
  19. int main() {
  20. make_obj(1);
  21. return 0;
  22. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty