lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/002 c5e0b01 04/14: Make currency class manda


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/002 c5e0b01 04/14: Make currency class mandatory
Date: Thu, 17 Sep 2020 16:27:14 -0400 (EDT)

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

    Make currency class mandatory
    
    The code is peppered with ".d()", so typedef'ing currency as an alias
    for double no longer works anyway.
---
 currency.hpp | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/currency.hpp b/currency.hpp
index f0c153d..8c0825a 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -32,26 +32,16 @@
 #include <iostream>                     // ostream
 #include <vector>
 
-#define USE_CURRENCY_CLASS
-
-#if !defined USE_CURRENCY_CLASS
-using currency = double;
-
 #if defined __GNUC__
 #   pragma GCC diagnostic ignored "-Wuseless-cast"
 #endif // defined __GNUC__
-#endif // !defined USE_CURRENCY_CLASS
 
-#if defined USE_CURRENCY_CLASS
 class currency
 {
     friend std::ostream& operator<<(std::ostream&, currency const&);
     friend class currency_test;
 
   public:
-  #if defined __GNUC__
-  #   pragma GCC diagnostic ignored "-Wuseless-cast"
-  #endif // defined __GNUC__
 //  using data_type = double;
 //  using data_type = long double;
     using data_type = std::int64_t;
@@ -212,8 +202,6 @@ inline std::ostream& operator<<(std::ostream& os, currency 
const& c)
     return os << c.to_double();
 }
 
-#endif // defined USE_CURRENCY_CLASS
-
 #if 0
 // Sloppy.
 inline currency requantize(double z) {return currency(z);}



reply via email to

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