<vector>: Avoid another compiler warning with Defect Report P2280R4 by StephanTLavavej · Pull Request #5566 · microsoft/STL (original) (raw)

Followup to #5550.

When Defect Report WG21-P2280R4 is implemented in MSVC, for libcxx's pathological tests for allocators with tiny size_types like uint8_t, the compiler will notice that _Ints_max * _VBITS undergoes integral promotion, but isn't smart enough to realize that we've avoided actual truncation.

We should consistently follow our pattern of static_casting to avoid warnings with integral promotions.