4 Apr
2016
4 Apr
'16
1:35 a.m.
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.