fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. struct foo;
  6.  
  7. template <typename T>
  8. struct bar {
  9. static int get_mem() {return T::mem;}
  10. };
  11.  
  12. template <typename T>
  13. struct baz: T {
  14.  
  15. };
  16.  
  17. int main() {
  18. // your code goes here
  19.  
  20. bar<foo>::get_mem();
  21.  
  22.  
  23. return 0;
  24. }
  25.  
  26. struct foo {
  27. static int mem;
  28. };
  29. int foo::mem = 0;
  30.  
  31. int main2() {
  32. baz<foo> x;
  33. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty