+ 1
Can compile-time constants be given values involving sizeof()?
Would something like const int kVar1 = sizeof(int) * 4; be considered a compile-time constant?
3 odpowiedzi
+ 10
sizeof is a compile time operator.
+ 4
Yes. In this case constexpr should be used instead of const. constexpr is a const compile time expression
+ 2
if it compile, then yes