lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/002 02d03f2 08/21: Discard more commented-ou


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/002 02d03f2 08/21: Discard more commented-out code
Date: Fri, 18 Sep 2020 21:53:47 -0400 (EDT)

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

    Discard more commented-out code
    
    In particular, there seems to be no need for operator double().
---
 currency.hpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/currency.hpp b/currency.hpp
index b50c11a..40a7808 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -87,7 +87,6 @@ class currency
 //  currency& operator=(double d) {m_ = from_double(d);           return 
*this;}
 //  currency& operator=(int    i) {m_ = cents_per_dollar * 
bourn_cast<data_type>(i); return *this;}
 
-//  operator double() const {return to_double();}
     double d() const {return to_double();}
 
     // Is this the ideal signature for this operator?
@@ -213,7 +212,6 @@ inline double operator/(double lhs, currency rhs) {return 
lhs /  rhs.d();}
 
 inline std::ostream& operator<<(std::ostream& os, currency const& c)
 {
-//  return os << c.m_ << ' ' << c.to_double();
     return os << c.to_double();
 }
 
@@ -222,8 +220,6 @@ inline std::vector<double> doubleize(std::vector<currency> 
const& z)
     std::vector<double> r;
     r.reserve(z.size());
     for(auto const& i : z)
-//      r.push_back(i.operator double()); // no need to convert explicitly
-// but that relies on a public operator double(), which is better avoided
         r.push_back(i.d());
     return r;
 }



reply via email to

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