fork(1) download
  1. #include <iostream>
  2.  
  3. struct DynamicSize
  4. {
  5. static const int size = -1;
  6. };
  7.  
  8. template<int Size>
  9. struct FixedSize
  10. {
  11. static const int size = Size;
  12. };
  13.  
  14. template<class T, class Size>
  15. class Container
  16. {
  17. public:
  18. Container()
  19. {
  20. std::cout << Size::size << "\n";
  21. }
  22. };
  23.  
  24. int main()
  25. {
  26. Container<char, FixedSize<20>> a;
  27. Container<char, DynamicSize> b;
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
20
-1