Boost logo

Boost :

From: Alex Rosenberg (alexr_at_[hidden])
Date: 2002-04-18 22:00:26


on 4/18/02 6:32 PM, David Abrahams at david.abrahams_at_[hidden] wrote:

> From: "Alex Rosenberg" <alexr_at_[hidden]>
>
>> Most smart pointers want to
>> be very small and low overhead.
>>
>> Perhaps a C++0x extension could fix this:
>>
>> class foo : public register empty_base { ... };
>>
>> Here I'm using "register" since it already indicates that the address cannot
>> be taken, but any suitable indicator could be used to resolve this.
>
> Implementations are already allowed to optimize away empty bases, and
> some do.

I have yet to see a compiler that can perform the empty base optimization
with multiple bases. Of course, I'd love to be surprised.

> My proposal is to use a single composite policies base class to avoid
> the MI overhead implicit in quite a few compilers.

If all policies can be reduced to a single base, then there's no problem.
Loki uses MI policies in several areas. Andrei previously expressed concern
over this issue in a post to comp.std.c++:

<http://groups.google.com./groups?hl=en&threadm=9eca6o%242153m%241%40ID-1403
6.news.dfncis.de&rnum=2&prev=/groups%3Fq%3Dandrei%2Bempty%2Bbase%26hl%3Den>

+------------------------------------------------------------+
| Alexander M. Rosenberg <mailto:alexr@_spies.com> |
| Nobody cares what I say. Remove the underscore to mail me. |


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