According to https://en.cppreference.com/w/cpp/language/integer_literal C++14 allows the single quote separator in integer types to help with readability:
Optional single quotes(') may be inserted between the digits as a separator. They are ignored by the compiler. [since C++14]
However, my question is whether it is safe to use it for floating point numbers too? The following code compiles without warnings for me, however, I'm concerned whether any implicit casting is happening due to the separator in the float:
int main()
{
int foo = 1'000;
float bar = 1'000.f;
}
Yes they are allowed. Looking at the floating-point literal page we have the same quote
Optional single quotes (') may be inserted between the digits as a separator; they are ignored during compilation. (since C++14)