Check out example codes for "c++ print vector without loop". It will help you in understanding the concepts better.

Code Example 1

template <typename T>
std::ostream& operator<< (std::ostream& out, const std::vector<T>& v) {
  if ( !v.empty() ) {
    out << '[';
    std::copy (v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
    out << "\b\b]";
  }
  return out;
}

Learn ReactJs, React Native from akashmittal.com