static_cast / float / bitset / const weirdness
Just a few hours ago, the following question came up: Variable cannot appear in a constant-expression Luckily for the OP, the answer provided did solve his problem, but I cannot reproduce the solution. I've attempted to simplify the code even more and I am now stuck with the following: #include <bitset> int main () { const size_t length_1 = static_cast<const size_t>(1.0f); std::bitset<length_1> bits_1; const size_t length_2 = static_cast<const size_t>(1.0f / 1.0f); std::bitset<length_2> bits_2; } If compiled with -pedantic , the first example is accepted by the compiler, but the one with a