20 template<
class InputIterator>
23 InputIterator first, InputIterator last,
24 std::string first_prefix, std::string later_prefix,
26 if (later_prefix.empty()) {
27 later_prefix = first_prefix;
33 std::ostringstream item;
35 std::string str = item.str();
37 indent(out, indent_level) << first_prefix << str;
38 int col = indent_level + (int)(first_prefix.length() + str.length());
42 while (first != last) {
43 std::ostringstream item;
45 std::string str = item.str();
47 col += 1 + str.length();
50 indent(out, indent_level) << later_prefix << str;
51 col = indent_level + (int)(later_prefix.length() + str.length());
void write_long_list(std::ostream &out, int indent_level, InputIterator first, InputIterator last, std::string first_prefix, std::string later_prefix, int max_col)
Writes a list of things to the indicated output stream, with a space separating each item.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.