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: | 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;
}
Note:
See TracTickets
for help on using tickets.
(In [77826]) Make vector print function in examples be more correct. Fixes #6677.