fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. enum class FooType { Default, Overridden };
  5.  
  6. template <FooType _FooType = FooType::Overridden>
  7. struct Foo { void foo() { cout << "default" << endl; } };
  8.  
  9. #if 0
  10. template <>
  11. struct Foo<FooType::Overridden> { void foo() { cout << "overridden" << endl; } };
  12. #endif
  13.  
  14. int main() {
  15. Foo<>().foo();
  16. return 0;
  17. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
default