Context
From Jarod on French C++ Discord:
123'456_I128 returns 123. Digit separators being all the more useful with large numbers. I don't know why the standard didn't strip ' from the template parameter of UDLs; every UDL now has to handle it itself.
Reproducer
See on Compiler Explorer: https://godbolt.org/z/bossonjGv
#include <https://raw.githubusercontent.com/Becheler/int128/refs/heads/boost_review/extra/int128_amalgamated.hpp>
#include <iostream>
#include <cassert>
int main()
{
using namespace boost::int128::literals;
const auto without_sep {123456_U128};
const auto with_sep {123'456_U128};
std::cout << "123456_U128 = " << without_sep << '\n';
std::cout << "123'456_U128 = " << with_sep << std::endl;
// Bug: the digit separator truncates parsing.
// Expected 123456, observed 123.
assert(with_sep == without_sep); // fails
return 0;
}
Context
From Jarod on French C++ Discord:
Reproducer
See on Compiler Explorer: https://godbolt.org/z/bossonjGv