Tuples: how to get rid off the open/closing characters??

Hello, looking into the code, the documentation, and the proposed standard I can't find a way to output a boost::tuple to a stream with no opening and closing characters??? tuples::tuple_open requires a character, and thus one has to use some opening character, and equally some closing character???? (I can't believe this: Everybody knows that adding strings is much easier than erasing them.) Oliver

looking into the code, the documentation, and the proposed standard I can't find a way to output a boost::tuple to a stream with no opening and closing characters???
Can't be done with the current interface. I started to work on a tuple_punct facet but in the end I just copied the code for operator<< and detail::print into my own functions and removed the separators. (Doesn't work together with the tuple_io header of course) I needed it for my own to_string function. template <typename TupleT> std::string to_string(const TupleT& arg) { std::ostringstream ss; ss << arg; return ss.str(); } Now I can do things like to_string(10); to_string(make_tuple(setw(10), &hex, 20));

On Tue, May 17, 2005 at 05:39:17PM +0000, Martin wrote:
looking into the code, the documentation, and the proposed standard I can't find a way to output a boost::tuple to a stream with no opening and closing characters???
Can't be done with the current interface.
Sigh; this really looks like a design flaw to me. (As a trivial fix of the design, couldn't one just interprete the zero value when passed as the character value to these manipulators as the "empty character" ?!) Thanks for the comment. Oliver
participants (2)
-
Martin
-
Oliver Kullmann