-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify the CurrencyValue protocol (#46)
Motivations: The current `CurrencyValue` protocol has a few requirements with default implementations that are not meant to be extension points on the protocol. In addition, a few aspects of how the protocol can be used are a bit rough in either performance or generic ergonomics. Modifications: - Add: `AdditiveArithmetic` conformance for free - Add: `@inlinable` annotations to remaining mutating and localization methods - Change: `minorUnits` and `roundedAmount` properties / initializers to be pure extensions Result: Developers are able to use `CurrencyValue` in greater generic contexts with slightly better performance capabilities, while also having more protection from incorrectly override expected behavior.
- Loading branch information
Showing
3 changed files
with
40 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters