|
Boost : |
Subject: Re: [boost] [function] Placement new warnings from gcc 6
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2016-04-03 21:35:19
On 3/04/2016 02:08, Andrey Semashev wrote:
> I guess, I could extract all members other than 'data' to a separate
> union and then:
>
> union function_buffer
> {
> mutable function_buffer_members m;
> mutable char data[sizeof(function_buffer_members)];
> };
>
> This would require more modifications to the code though.
>
> (Sigh... if only we could inherit unions...)
Could you do this with an anonymous union? eg:
union function_buffer
{
mutable union function_buffer_members
{
...
};
mutable char data[sizeof(function_buffer_members)];
};
Haven't tested this; not sure if it's legal to get the sizeof a subtype
nested in the same scope like this, but it at least seems plausible.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk