C++ Logo

sg12

Advanced search

Re: [ub] type punning through congruent base class?

From: Jean-Marc Bourguet <jm_at_[hidden]>
Date: Mon, 06 Jan 2014 17:17:36 +0100
On Mon, 6 Jan 2014 18:11:36 +0200, Ville Voutilainen
<ville.voutilainen_at_[hidden]> wrote:
> On 6 January 2014 17:34, Fabio Fracassi <f.fracassi_at_[hidden]> wrote:
>> It would enable us to extend or change the interface of a class without
>> copying or moving the underlying object (think mixin without additional data).
>
> Why don't you just construct D with a B&?

The only reason I can think is to access protected members, but I'll
argue that's
a good reason not to allow that.

Yours,

-- 
Jean-Marc

Received on 2014-01-07 00:24:10