fork download
  1. #include <iostream>
  2.  
  3. class Foo
  4. {
  5. public:
  6. int bar();
  7. protected:
  8. static constexpr int BAR {4};
  9. };
  10.  
  11. int Foo::bar() { return Foo::BAR; }
  12.  
  13. int main() {
  14. Foo foo;
  15. std::cout << foo.bar();
  16. return 0;
  17. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
4