fork download
  1. #include <array>
  2. #include <cstddef>
  3.  
  4. template <typename T>
  5. struct identity
  6. {
  7. using type = T;
  8. };
  9.  
  10. template <typename T>
  11. using eval = typename T::type;
  12.  
  13. template <typename T>
  14. struct make_std_array
  15. : identity<T> {};
  16.  
  17. template <typename T, std::size_t N>
  18. struct make_std_array<T[N]>
  19. : identity<std::array<eval<make_std_array<T>>,N>> {};
  20.  
  21. template <typename T>
  22. using std_array = eval<make_std_array<T>>;
  23.  
  24. #include <type_traits>
  25. static_assert( std::is_same<std_array<int[3][4]>, std::array<std::array<int, 4>, 3>>::value, "" );
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i486-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty