Guest User

Untitled

a guest
Sep 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. template <class T>
  2. void Yeap(T);
  3.  
  4. int main() {
  5. Yeap(0);
  6. return 0;
  7. }
  8.  
  9. template <class T>
  10. void YeapImpl();
  11.  
  12. struct X;
  13.  
  14. template <class T>
  15. void Yeap(T) {
  16. YeapImpl<X>(); // pass X to another template
  17. }
  18.  
  19. template <class T>
  20. void YeapImpl() {
  21. T().foo();
  22. }
  23.  
  24. struct X {
  25. void foo() {}
  26. };
Add Comment
Please, Sign In to add comment