fork download
  1. namespace X
  2. {
  3. namespace Y
  4. {
  5. template <typename R, typename ...T>
  6. R foo(T&&... args)
  7. {
  8. R r(args...);
  9. return r;
  10. }
  11. }
  12. }
  13.  
  14. class A
  15. {
  16. template <typename R, typename ...T>
  17. friend R X::Y::foo(T&&... args);
  18. A(int x, int y){}
  19. };
  20.  
  21. int main()
  22. {
  23. X::Y::foo<A>(1, 2);
  24. }
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout

Standard output is empty