fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <array>
  4.  
  5. template <class T, size_t N>
  6. std::ostream& operator<<(std::ostream& o, const std::array<T, N>& arr)
  7. {
  8. copy(arr.cbegin(), arr.cend(), std::ostream_iterator<T>(o, " "));
  9. return o;
  10. }
  11.  
  12.  
  13. int main () {
  14. std::array<int, 3> a = { 1, 2, 3 };
  15. std::cout << a << std::endl;
  16. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1 2 3