
Also, you can save a format object, e.g.: // old style containerfmt_t< char, pairfmt_t< char > > myformat = containerfmt( pairfmt().format( " = "
)).format( "<< ", "
" );
std::cout << formatob( vec, myformat ); // << ( a = 5 ), ( b = 7 ), ...
std::cout << formatob( lst, myformat ); // << ( i = 2.132 ), ( j = 3.14159 ), ... >> std::cin >> formatob( vec, myformat );
And now I need to write
std::cout << formatob( lst, myformat );
every time I print list? No, thank you.
As opposed to Foo(lst, std::cout)? I would certainly go with the former... Also, if you read the rest of the thread, you would have noticed that there were a lot of talk about storing the formatter within the stream itself. Reece has proposed quite a few solutions - and I'm sure he'll come up with a very good one in the end. What he was explaining is how things are done now - in this version of the library. Best, John -- John Torjo -- john@torjo.com Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.4 - save_dlg - true binding of your data to UI controls! + easily add validation rules (win32gui/examples/smart_dlg)