Boost.Format for variadic numbers of arguments
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
4650
Age (days ago)
4650
Last active (days ago)
0 comments
1 participants
participants (1)
-
Philipp Moeller