20 Feb
2012
20 Feb
'12
10:43 a.m.
I currently have a lot of code that formats list into something readable. Is it possible to do something like: boost::format fmt("List [ %V,%]"); std::vectorstd::string c = {"foo", "bar" }; std::for_each(begin(c), end(c), [&fmt](const std::string& x) { fmt % x; }); Where V would indicate a variable list and the character constant immediately after it would be the separator. (I'm not sure about V as a parameter, but someone more familiar with the library might have an answer to that.) Alternatively, suggestions for a flexible container pretty printer would be welcome as well. Cheers, Philipp Moeller