
Another thing that explore provides beyond the basic 'cout << c' is a set of extendable manipulators. These behave like existing std manipulators to modify the formatting of the output. Love them or hate them, they are familiar to a large base of developers. In particular, the cols and item_width manipulators together provide a simple but powerful way to stream numeric data. Can either serialization or karma handle this as easily? -- Jeff Faust #include <boost/explore/map.hpp> #include <boost/explore/vector.hpp> #include <iostream> #include <string> using namespace std; using namespace boost::explore; int main() { map<int, string> mis; cout << mis << endl; // [] mis[1] = "Hello"; cout << mis << endl; // [1:Hello] cout << quote_strings << mis << endl; // [1:"Hello"] vector<int> vi; for( int i = 1; i <= 9; ++i ) vi.push_back(i*2); cout << vi << endl; // [2, 4, 6, 8, 10, 12, 14, 16, 18] cout << delimiters("", " ", ""); cout << vi << endl; // 2 4 6 8 10 12 14 16 18 cout << cols(3) << vi << endl; // 2 4 6 // 8 10 12 // 14 16 18 cout << item_width(3) << vi << endl; // 2 4 6 // 8 10 12 // 14 16 18 }