fork(2) download
  1. #include <array>
  2. #include <string>
  3.  
  4. template<size_t N>
  5. struct constant_integer
  6. {
  7. enum { size = N };
  8. };
  9.  
  10. template<size_t N, typename T>
  11. constant_integer<N> array_size( const std::array<T, N>& );
  12.  
  13. int main(void)
  14. {
  15. std::array<std::string, 42> a1;
  16. std::array<int, decltype(array_size(a1))::size> a2;
  17. }
  18.  
Success #stdin #stdout 0s 2848KB
stdin
Standard input is empty
stdout
Standard output is empty