fork download
  1. #include <iostream>
  2.  
  3. template<class T>
  4. class Wrapper
  5. {
  6. public:
  7. Wrapper(T t) : t_(t)
  8. {}
  9. private:
  10. T t_;
  11. };
  12.  
  13. template<class... Args>
  14. void g(Args&&...)
  15. {
  16. std::cout << __PRETTY_FUNCTION__ << '\n';
  17. }
  18.  
  19. template<class... Args>
  20. void f(Args&&... args)
  21. {
  22. std::cout << __PRETTY_FUNCTION__ << '\n';
  23. g(std::forward<Wrapper<Args>>(args)...);
  24. }
  25.  
  26. int main()
  27. {
  28. f(1, 2.0, "three");
  29. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
void f(Args&& ...) [with Args = {int, double, const char (&)[6]}]
void g(Args&& ...) [with Args = {Wrapper<int>, Wrapper<double>, Wrapper<const char (&)[6]>}]