lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/005 d763c34 04/10: Clean up


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/005 d763c34 04/10: Clean up
Date: Thu, 21 Jan 2021 17:48:15 -0500 (EST)

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

    Clean up
---
 currency.hpp      |  7 +------
 currency_test.cpp | 13 +------------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/currency.hpp b/currency.hpp
index f2a7dea..45e11d7 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -24,8 +24,6 @@
 
 #include "config.hpp"
 
-#include "so_attributes.hpp" // CURRENCY !! iff a separate TU is ever wanted
-
 #include <ostream>
 #include <vector>
 
@@ -42,8 +40,6 @@ using currency = double;
 
 inline currency from_cents(double z) {return z / 100.0;}
 
-// CURRENCY !! Rename these both to 'dblize'.
-
 inline double dblize(currency z) {return z;}
 
 inline std::vector<double> dblize(std::vector<currency> const& z)
@@ -57,8 +53,7 @@ inline std::vector<double> dblize(std::vector<currency> 
const& z)
 
 class raw_cents {}; // Tag class.
 
-// CURRENCY !! "LMI_SO" iff some part eventually becomes a TU.
-class LMI_SO currency
+class currency
 {
     friend class currency_test;
     template<typename> friend class round_to;
diff --git a/currency_test.cpp b/currency_test.cpp
index 54112f4..5393d6d 100644
--- a/currency_test.cpp
+++ b/currency_test.cpp
@@ -40,7 +40,6 @@ class currency_test
     static void test();
 
   private:
-    static void test_something();
     static void test_default_ctor();
     static void test_copy_ctor();
     static void test_explicit_ctor();
@@ -60,7 +59,6 @@ class currency_test
 
 void currency_test::test()
 {
-    test_something();
     test_default_ctor();
     test_copy_ctor();
     test_explicit_ctor();
@@ -240,16 +238,8 @@ void currency_test::test_quodlibet()
     BOOST_TEST_EQUAL(b2, b3);
 }
 
-// !! actually tests nothing--expunge
-void currency_test::test_something()
-{
-// Figure out what to do about this:
-//  currency a1(3.14);
-// It seems best to provide no converting ctor:
-//  currency a1(3.25);
-
+// CURRENCY !! Ideas for testing overflow or underflow.
 #if 0
-    // This is curious, but may not belong here.
 //  double big_num = nonstd::power(2.0, 53);
     double big_num = 1.0e100;
     currency::data_type big_int1 =   1.0 * big_num;
@@ -276,7 +266,6 @@ std::cout << big_int3 << '\n' << 1.0e102 << '\n' << 
big_int3 - 1.0e102 << std::e
         ,"Cannot cast infinite to integral."
         );
 #endif // 0
-}
 
 int test_main(int, char*[])
 {



reply via email to

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