fork download
  1. #include <array>
  2. #include <iostream>
  3.  
  4. constexpr int b = 2, c = 3;
  5. constexpr int a = b * c;
  6.  
  7. class Foo {
  8. public:
  9. std::array<int, a> data;
  10. };
  11.  
  12. int main() {
  13. Foo f {};
  14. std::cout << sizeof(f.data) / sizeof(decltype(f.data)::value_type) << std::endl;
  15. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
6