Gennadiy Rozental wrote:
Michiel Helvensteijn
writes: Hm, yes. You're afraid they will change the structure of that namespace from under our feet without even putting it in a changelog.
Given that possibility, might it not be better to put it in namespace std anyway...
Perhaps they should offer us a real solution in the next version?
'They' are open to any suggestions ;)
Gennadiy
I suggested that boost should actually only print adapters to the
stream. The default behavior would be to
template<class T>
struct repr_type{
typedef T type;
T make(T value) {return value;}
};
template<class T>
typename repr_type<T>::type repr(T& value) {
return repr_type<T>::make(value);
}
Then to print log messages:
stream << repr<>(obj1) << repr<>(obj2);
and to customize output when overloading operator << is not possible,
you can use template specialization.
template<class T> struct repr_type