从Swift 4中删除了toUIntMax()和toIntMax()

前端之家收集整理的这篇文章主要介绍了从Swift 4中删除了toUIntMax()和toIntMax()前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

是什么替换了方法toUIntMax()和Swift 4中的方法toIntMax()?该错误发生在FacebookCore框架内。

任何帮助,将不胜感激

作为 SE-104的一部分,IntMax的概念已被完全删除

Converting from one integer type to another is performed using the concept of the ‘maximum width integer’ (see MaxInt),which is an artificial limitation. The very existence of MaxInt makes it unclear what to do should someone implement Int256,for example.

The proposed model eliminates the ‘largest integer type’ concept prevIoUsly used to interoperate between integer types (see toIntMax in the current model) and instead provides access to machine words. It also introduces the multipliedFullWidth(by:),dividingFullWidth(_:),and quotientAndRemainder methods. Together these changes can be used to provide an efficient implementation of bignums that would be hard to achieve otherwise.

在这种特定情况下,FB SDK应该只使用UInt64($ 0)初始化程序,由于新协议,它现在可用于任何BinaryInteger类型。

原文链接:https://www.f2er.com/swift/320264.html

猜你在找的Swift相关文章