lmi-commits
[Top][All Lists]

## [lmi-commits] [lmi] valyuta/002 39eb954 36/65: symmetric binary operator

 From: Greg Chicares Subject: [lmi-commits] [lmi] valyuta/002 39eb954 36/65: symmetric binary operators Date: Wed, 16 Sep 2020 16:55:17 -0400 (EDT)

```branch: valyuta/002
commit 39eb954d49ae220ff4bb9676f476caf64c610f6a
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

symmetric binary operators
---
currency.hpp | 2 ++
1 file changed, 2 insertions(+)

diff --git a/currency.hpp b/currency.hpp
index 30cb132..8f9857a 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -188,7 +188,9 @@ inline bool operator>=(double   const& lhs, currency const&
rhs){return !operato
inline currency operator+(currency lhs, currency rhs) {return lhs += rhs;}
inline currency operator-(currency lhs, currency rhs) {return lhs -= rhs;}
inline currency operator+(currency lhs, double rhs) {return lhs +=
currency(rhs);}
+inline currency operator+(double lhs, currency rhs) {return currency(lhs) +=
rhs;}
inline currency operator-(currency lhs, double rhs) {return lhs -=
currency(rhs);}
+inline currency operator-(double lhs, currency rhs) {return currency(lhs) -=
rhs;}
//inline currency operator*(currency lhs, double rhs) {return lhs *=
currency(rhs);}
////inline double operator*(currency lhs, double rhs) {return lhs *=
currency(rhs);}
// Don't actually want any member operator*() for double:

```