C ++ 14 introduced the concept of numeric delimiters to literals along lines 3'141'592'653'589 . Now this is a great feature for readable code, but I was wondering if it allowed quotes before the numeric part of the literal 0x/0b -type. I think that:
unsigned int topThreeBits = 0b'1110'0000; unsigned int hexNum = 0x'dead'beef;
more readable than one that does not have a leading separator:
unsigned int topThreeBits = 0b1110'0000; unsigned int hexNum = 0xdead'beef;
because it clearly defines the base of the numbers.
Since I don't have a C ++ 14 compiler yet, I need to confirm something if this is allowed.
I know this doesn't make sense for non-prefix numbers like '123'456 , especially since the parser didn't know if it should be a char variable or a numeric literal.
But for prefix literals, I see no confusion about what the token means at the point where the first one arrives - 0x/0b already dictated this as a numeric literal.
c ++ c ++ 14 digit-separator
paxdiablo
source share