Given:
template <int N>
struct val2size
{
char placeholder[N];
};
Is there any guarantee that sizeof(val2size<N>) == N
?
The only guarantee is that
sizeof(val2size<N>) >= N
There may be unnamed padding at the end of the struct. I don't think it's likely that there will be unnamed padding, but it's possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With