Opened 11 years ago

Closed 11 years ago

#6677 closed Bugs (fixed)

Example helper function for printing vectors should use passed std::ostream instead of std::cout

Reported by: Grigory Sokolov <greg.sokolov@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.49.0 Severity: Cosmetic
Keywords: Cc:

Description

Affected files: example/multiple_sources.cpp, example/options_description.cpp

template<class T> ostream& operator<<(ostream& os, const vector<T>& v) {

copy(v.begin(), v.end(), ostream_iterator<T>(cout, " ")); return os;

}

should be replaced with

template<class T> ostream& operator<<(ostream& os, const vector<T>& v) {

copy(v.begin(), v.end(), ostream_iterator<T>(os, " ")); return os;

}

Change History (1)

comment:1 by Vladimir Prus, 11 years ago

Resolution: fixed
Status: newclosed

(In [77826]) Make vector print function in examples be more correct. Fixes #6677.

Note: See TracTickets for help on using tickets.