fork download
  1. #include <iostream>
  2.  
  3. template <bool condition>
  4. struct Conditional
  5. {
  6. static void f();
  7. };
  8.  
  9. template <>
  10. void Conditional<true>::f() { std::cout << "true\n"; }
  11.  
  12. template <>
  13. void Conditional<false>::f() { std::cout << "false\n"; }
  14.  
  15. int main()
  16. {
  17. Conditional<true>::f();
  18. Conditional<false>::f();
  19. }
  20.  
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
true
false