Re: New compose and format API



Am Montag, den 27.08.2007, 13:17 -0400 schrieb Paul Davis:

> template <class T> std::string 
> to_string (T t, std::ios_base & (*f)(std::ios_base&))
> {
> 	std::ostringstream oss;
> 	oss << f << t;
> 	return oss.str();
> }
> 
> other than its potential inefficiences, what are the defects with this?

It only works for I/O manipulators without arguments.  According to
Josuttis, there's no portable way to have manipulators with arguments as
function parameters.  If there were a way to do that we could have
solved the ambiguity of Ole's compose API by adding overloads for
manipulators.

--Daniel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]