Advertisement
TheFaceTakt

Untitled

Dec 21st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <cstdio>
  2.  
  3. template<bool x>
  4. struct A
  5. {
  6.     void meow()
  7.     {
  8.         printf("meow\n");
  9.     }
  10. };
  11.  
  12. template<>
  13. struct A <true>
  14. {
  15.     void gav()
  16.     {
  17.         printf("gav\n");
  18.     }
  19. }
  20.  
  21.  
  22. int main()
  23. {
  24.     A<true> x;
  25.     A<false> y;
  26.     y.meow();
  27.     x.meow();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement