msvc's code analyzer for the cpp core guidelines tells me
Warning C26472 Don't use a
static_castfor arithmetic conversions. Use brace initialization,gsl::narrow_castorgsl::narrow(type.1).
for this snippet
static_cast<IntType>(static_cast<unsigned long long>(hexValue(digit)) << (digitIdx * 4));
Why shouldn't I use static_cast here?
Also, with brace init this would look like this
IntType{unsigned long long{hexValue(digit)} << (digitIdx * 4)};
which doesn't look any better imo. This looks more like a function style cast than anything else.
I cannot use gsl and I think gsl::narrow is a wrapper around static_cast itself, so is this purely a readability issue here?