lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master f47e374 2/5: Refactor verify_one_cell()


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f47e374 2/5: Refactor verify_one_cell()
Date: Mon, 11 Mar 2019 19:40:41 -0400 (EDT)

branch: master
commit f47e374779f6f45327a73ba9f93b1531566dfd7f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Refactor verify_one_cell()
    
    Shortened some lines that were over eighty characters wide.
    
    Made some local variables const.
    
    Used 'auto' on the left-hand side of assignment from casts.
---
 verify_products.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/verify_products.cpp b/verify_products.cpp
index 88c09fa..640eb65 100644
--- a/verify_products.cpp
+++ b/verify_products.cpp
@@ -48,32 +48,32 @@ void verify_one_cell
 {
     Input input;
     input["ProductName"] = z;
-    input["Gender"] = g;
-    input["Smoking"] = s;
-    yare_input yi(input);
-    product_database db(yi);
-    oenum_cso_era const era = db.query<oenum_cso_era>(DB_CsoEra);
-    oenum_alb_or_anb const a_b = 
db.query<oenum_alb_or_anb>(DB_AgeLastOrNearest);
-    int const t = db.query<int>(DB_Irc7702QTable);
+    input["Gender"     ] = g;
+    input["Smoking"    ] = s;
+    yare_input       const yi(input);
+    product_database const db(yi);
+    auto const era = db.query<oenum_cso_era   >(DB_CsoEra);
+    auto const a_b = db.query<oenum_alb_or_anb>(DB_AgeLastOrNearest);
+    auto const t   = db.query<int             >(DB_Irc7702QTable);
     if(0 == t)
         return;
-    std::vector<double> v0 = cso_table
+    std::vector<double> const v0 = cso_table
         (era
         ,oe_orthodox
         ,a_b
         ,mce_gender (g).value()
         ,mce_smoking(s).value()
         );
-    product_data p(z);
+    product_data const p(z);
     std::string const f = AddDataDir(p.datum("Irc7702QFilename"));
-    actuarial_table a(f, t);
-    std::vector<double> v1 = a.values
+    actuarial_table const a(f, t);
+    std::vector<double> const v1 = a.values
         (a.min_age()
         ,1 + a.max_age() - a.min_age()
         );
     if(v0 == v1)
         {
-        std::cout << "validated: table " << t << ' ' << g << ' ' << s << 
std::endl;
+        std::cout << "okay: table " << t << ' ' << g << ' ' << s << std::endl;
         }
     else
         {



reply via email to

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