fork download
  1. template<bool Condition, typename T = void>
  2. struct EnableIf
  3. {
  4. };
  5. template<typename T>
  6. struct EnableIf<true, T>
  7. {
  8. typedef T Type;
  9. };
  10.  
  11. struct Base
  12. {
  13. static const int Foo = 0;
  14. };
  15.  
  16. template<int KeySize>
  17. struct Derived : public EnableIf<true, Base>::Type
  18. {
  19. static const int Bar = Foo;
  20. };
  21.  
  22. int main()
  23. {
  24. Derived<42> Inst;
  25. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty