I was able to do the primitive
long double result = 0.0;
while (...) {
if (json[head] == '.') ...
result *= 10; result += json[head] - '0';
}in a constexpr function with no problem :)