M
ma740988
If I understand placement new. Object destruction requires an explicit
call to the destructor.
struct my_struct {
unsigned int val1 : 5;
unsigned int val2 : 4;
unsigned int reserved : 23;
};
Now given an address - say 0x40000000. For the case where I have bit
fields. What's the approach on the constructor/destructor here?
I suspect:
my_struct *m = new (0x40000000) my_struct;
// clean up?
Thanks in advance
call to the destructor.
struct my_struct {
unsigned int val1 : 5;
unsigned int val2 : 4;
unsigned int reserved : 23;
};
Now given an address - say 0x40000000. For the case where I have bit
fields. What's the approach on the constructor/destructor here?
I suspect:
my_struct *m = new (0x40000000) my_struct;
// clean up?
Thanks in advance