Why does this code:
constexpr float operator "" _deg(long double d) {
// returns radians
return d*3.1415926535/180;
}
static const float ANGLES[] = {-20_deg, -10_deg, 0_deg, 10_deg, 20_deg};
Produce 5 of these errors:
error: unable to find numeric literal operator 'operator"" _deg'
I am using GCC 4.7.3. (arm-none-eabi-g++
, with the -std=c++0x
flag).