是否有一种标准的一致且可移植的方法可以在编译时检查一种浮点类型的所有值是否可以在另一种浮点类型中表示?另请考虑即将推出的类型,例如 std::bfloat16_t。
可以使用
std::is_convertable
static_assert