fork download
  1. #include <iostream>
  2. #define MACRO(y, x) template <typename...T> void _func_##x(T...t) { \
  3. some.y.func_##x(t...); \
  4. }
  5.  
  6. class first
  7. {
  8. public:
  9. void func_example(const char* str)
  10. {
  11. std::cout << str;
  12. }
  13. };
  14.  
  15. class second
  16. {
  17. public:
  18. first othersome;
  19. } some;
  20.  
  21. MACRO(othersome, example);
  22.  
  23. int main()
  24. {
  25. _func_example("Hello, World!");
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Hello, World!