Boost logo

Boost :

From: Joao Abecasis (jpabecasis_at_[hidden])
Date: 2004-09-09 11:00:50


David Abrahams wrote:

> I think the question is whether it's ever desirable to break the
> current C++ invariant that no two objects of the same type will ever
> share an address **in generic code** -- that is, when you don't know
> anything about the assumptions that may be made by that type.

An alternative implementation is to privately inherit from the specified
type for empty classes as compressed_pair does. This maintains the
invariant but has the drawback that inheritance is visible in user code.

For a generic compressed_tuple the private inheritance should not be a
problem.

João


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