2 ms·
Sure, as per my other comment, it then would be an object representation violation. Even ignoring both rules, there is still no reason to expect the assertion
by gpderetta 4y ago
Sure, as per my other comment, it then would be an object representation violation.
Even ignoring both rules, there is still no reason to expect the assertion not to fire:
int x = 2;
assert(*(bool*)x == true);
This is the same as:
float x = 2.0
assert(*(int*)x == 2);
Just because two object are convertible, there is no reason to expect their representation to be the same.