Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

(C++) std::ostream_iterator

 

An iterator.

 

Example: CoutVector

 

 

#include <vector>

#include <iterator>

#include <iostream>

#include <ostream>

 

//From http://www.richelbilderbeek.nl/CppCoutVector.htm

template <class T>

void CoutVector(const std::vector<T>& v)

{

std::copy(v.begin(),v.end(),std::ostream_iterator<T>(std::cout,"\n"));

}

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.