Skip to content

Latest commit

 

History

History
49 lines (26 loc) · 1.08 KB

CppStdOstream_iterator.md

File metadata and controls

49 lines (26 loc) · 1.08 KB

 

 

 

 

 

(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")); }