What exactly as been assigned to value? I am surprised that this has compiled at all.
//g++ 7.4.0
#include <iostream>
int main()
{
auto value = 123'456'7;
std::cout << value << std::endl;
value += 1;
std::cout << value << std::endl;
}
outputs:
1234567
1234568
Since C++14,
from https://en.cppreference.com/w/cpp/language/integer_literal
Optional single quotes(') may be inserted between the digits as a separator. They are ignored by the compiler.
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