refactor: quantity_point::quantity_from_origin() refactored to quantity_point::quantity_ref_from(PO)

Resolves #479 and relates to #477
This commit is contained in:
Mateusz Pusz
2023-09-13 10:09:08 +02:00
parent a7711cb301
commit 3b2ca4084a
9 changed files with 191 additions and 147 deletions
+2 -2
View File
@@ -93,6 +93,6 @@ int main()
quantity_point price_usd = zero + 100 * us_dollar;
quantity_point price_euro = exchange_to<euro>(price_usd);
std::cout << price_usd.quantity_from_origin() << " -> " << price_euro.quantity_from_origin() << "\n";
// std::cout << price_usd.quantity_from_origin() + price_euro.quantity_from_origin() << "\n"; // does not compile
std::cout << price_usd.quantity_ref_from(zero) << " -> " << price_euro.quantity_ref_from(zero) << "\n";
// std::cout << price_usd.quantity_ref_from(zero) + price_euro.quantity_ref_from(zero) << "\n"; // does not compile
}