Boost logo

Boost :

From: Joao Abecasis (jpabecasis_at_[hidden])
Date: 2004-09-09 08:01:05


John Maddock wrote:

> How does this differ from boost::compressed_pair ?

Well, compressed_pair applies to a pair and compressed_member applies
memberwise. In a situation where you have more than two members
compressed_member may compact better.

Consider this situation:

    struct A {};
    struct B {};

    struct C
    : compressed_member<A>
    , compressed_member<A, 1>
    , compressed_member<B, 1>
    , compressed_member<B, 1>
    {
    };

Here, each A gets its address but the Bs can share those same addresses.
I think applying the optimization memberwise may scale better for
arbitrary tuples.

Regards,

João Abecasis


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