Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-05-19 05:36:43


David Abrahams wrote:
> I find myself creating this class member:
>
> compressed_pair<
> storage
> , compressed_pair<
> Lookup
> , compressed_pair<
> GetUnstored
> , SetUnstored
> >
> >
> > members;

Just one comment here: shouldn't the storage member be in the innermost
compressed_pair? Currently the innermost item compressed_pair<GetUnsorted,
SetUnsorted> has two empty members and so isn't actually "compressed".

Using:

compressed_pair<
    empty1,
    compressed_pair<
        empty2,
        compressed_pair<
            empty3,
            storage> > >

ensures that each compressed pair has one non-empty member and one empty
member, so the final object should be just sizeof(storage).

All of which suggests that a compressed-tuple would be a good idea, although
ordering the items within the tuple to ensure compression is actually a
larger challenge than folks may have realised.

In the mean time if additional template constructors can be added, I see no
problem with that.

John.


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