Boost logo

Boost :

From: Martin (adrianm_at_[hidden])
Date: 2005-05-17 12:39:17


>
> 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));


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk