Guest User

Untitled

a guest
Jun 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #define C 3
  4.  
  5. template<int N, int M=N%C> struct Foo {
  6. Foo() { std::cout << N << " % " << C << " != 0" << std::endl; }
  7. };
  8. template<int N> struct Foo<N, 0> {
  9. Foo() { std::cout << N << " % " << C << " = 0" << std::endl; }
  10. };
  11.  
  12. int main() {
  13. Foo<0> p0;
  14. Foo<1> p1;
  15. Foo<2> p2;
  16. Foo<3> p3;
  17. }
Add Comment
Please, Sign In to add comment