Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. template<int T>
  4. class NumberPrinter
  5. {
  6.    static void print() { std::cout << T << std::endl; }
  7. }
  8.  
  9. template<>
  10. class NumberPrinter<2>
  11. {
  12.    static void print() { std::cout << "Dois" << std::endl; }
  13. }
  14.  
  15. void main()
  16. {
  17.     NumberPrinter<2>::print();
  18.     NumberPrinter<4>::print();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement