lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] valyuta/002 4b313b0 07/21: Discard some commented-ou


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/002 4b313b0 07/21: Discard some commented-out code
Date: Fri, 18 Sep 2020 21:53:47 -0400 (EDT)

branch: valyuta/002
commit 4b313b0e96cc841e352687bf3977bde42489b13f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Discard some commented-out code
    
    Write relational operators out of line, rather than as members: this
    should generate the same code, and makes the class definition smaller.
    Maybe C++20's operator<=> will replace this anyway, someday.
---
 currency.hpp | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/currency.hpp b/currency.hpp
index dc4604c..b50c11a 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -90,25 +90,6 @@ class currency
 //  operator double() const {return to_double();}
     double d() const {return to_double();}
 
-#if 0
-    // Is this better, with 'const&'?
-//  bool operator==(currency const& z) const {return z.m_ == m_;}
-
-    bool operator< (currency z) const {return m_ <  z.m_;}
-    bool operator<=(currency z) const {return m_ <= z.m_;}
-    bool operator==(currency z) const {return m_ == z.m_;}
-    bool operator!=(currency z) const {return m_ != z.m_;}
-    bool operator> (currency z) const {return m_ >  z.m_;}
-    bool operator>=(currency z) const {return m_ >= z.m_;}
-
-    bool operator< (double d) const {return to_double() <  d;}
-    bool operator<=(double d) const {return to_double() <= d;}
-    bool operator==(double d) const {return to_double() == d;}
-    bool operator!=(double d) const {return to_double() != d;}
-    bool operator> (double d) const {return to_double() >  d;}
-    bool operator>=(double d) const {return to_double() >= d;}
-#endif // 0
-
     // Is this the ideal signature for this operator?
 //  currency operator-() const {return currency(-m_);}
 //  currency& operator-() {m_ = -m_; return *this;}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]