fork download
  1. #include <iostream>
  2. #include <array>
  3.  
  4. class A{
  5. public:
  6. const static std::array<int,3> m;
  7. void func(){
  8. std::cout<<A::m[0];
  9. };
  10. };
  11.  
  12. constexpr std::array<int, 3> A::m = {1,2,3};
  13. A a;
  14.  
  15. int main(){
  16. a.func();
  17. return 0;
  18. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
1