The integer types saturating_cast clamps: the integral types, and __int128 / unsigned __int128 where the compiler has them.
More...
template<typename T>
struct mtl::detail::sat_traits< T >
The integer types saturating_cast clamps: the integral types, and __int128 / unsigned __int128 where the compiler has them.
Under strict -std=c++20 (MTL5's own build) std::is_integral is false for those, so a cast from __int128 skipped the clamp and truncated (issue 865). Their signedness and limits are given here too: with MSVC's standard library (clang-cl) std::numeric_limits is not specialized for them, so is_signed was false and min() and max() were 0 (#871, Windows Clang-CL).