Boost logo

Boost :

From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2007-05-28 07:08:02


> OK, although I'm a bit confused: boost::tuple<> is not a container in
> the normal sense. So what has this got to do with container traits?

How would one control the output mechanism of boost::tuple using boost
range?
Boost range doesn't help much when it comes to outputting something like
tuple<std::vector<T> >, since the global operator<< can't be invoked for
vector<T>.

Working with containers, not only ranges, is such a common task that it
shouldn't require twenty or so overloads to describe one function. Boost
Range is indeed helpful and I use it a lot, but I don't think its existence
makes container_traits useless.

/ Christian

On 24/05/07, Thorsten Ottosen <thorsten.ottosen_at_[hidden]> wrote:
>
> Christian Holmquist skrev:
> >> There is no is_range<T>::value trait. So no.
> >> Is that needed for output?
> >
> > Well, if I have a boost::tuple<std::vector<int> >, how would I output
> that
> > using the stream operators of boost::tuple? or boost::variant, or fusion
> > sequences, etc..
> >
> > With container traits I get both input and output for free here.
>
> OK, although I'm a bit confused: boost::tuple<> is not a container in
> the normal sense. So what has this got to do with container traits?
>
> -Thorsten
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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