Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow addition / subtraction of default MonetaryAmount with any other (neutral element) #348

Merged
merged 1 commit into from
Nov 6, 2022

Conversation

sjanel
Copy link
Owner

@sjanel sjanel commented Nov 6, 2022

This has one main benefit: containers of MonetaryAmount can be initialized with default MonetaryAmounts that will be involved in additions / subtraction later on.
Example:

vector<MonetaryAmount> v(10); // 10 default MonetaryAmount
v[0] += MonetaryAmount(10, "EUR");
v[1] += MonetaryAmount(2000, "KRW");

@sjanel sjanel added the enhancement New feature or request label Nov 6, 2022
@sjanel sjanel merged commit 325f5f8 into main Nov 6, 2022
@sjanel sjanel deleted the feature/monetary-amount-neutral-element-addition branch November 6, 2022 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant