For generic code, which would otherwise have to invent some SFINAE
"use castInto() if the types are different and Utility::copy()
otherwise" nastiness in every such case, and that's just annoying.
Because yes of course dealing with a JSON just isn't possible
without having to make decisions between insufficiently imprecise
integers and unnecessarly overprecise doubles.
There's now 24 overloads for unsigned types and 24 for signed types,
which is all possible combinations. Not adding an ability to cast
between signed and unsigned as I'm not sure what should be done there.
But only in the vcpkg package and only with 19.16.27034 (not 27035), so
probably some combination of /permissive- and a compiler bug is to
blame.
The template keyword was unnecessary in any case, it probably got copied
from elsewhere by accident.
It's a lot of code, but it still seems to be the fastest option of all
we have. This was the original idea when implementing half-float support
in 2016 but then I shelved it in favor of a simpler (but slower) code,
keeping the table only for the benchmark, calculated at runtime. But now
we need a batch version of this, so this comes handy.