Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- template<int T>
- class NumberPrinter
- {
- static void print() { std::cout << T << std::endl; }
- }
- template<>
- class NumberPrinter<2>
- {
- static void print() { std::cout << "Dois" << std::endl; }
- }
- void main()
- {
- NumberPrinter<2>::print();
- NumberPrinter<4>::print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement