lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/004 223cb61 3/3: Prefer an explicit zero to


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/004 223cb61 3/3: Prefer an explicit zero to "{}"
Date: Mon, 14 Dec 2020 10:40:01 -0500 (EST)

branch: valyuta/004
commit 223cb61c36a373fc64784881264146d22b73edee
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Prefer an explicit zero to "{}"
    
    Writing (e.g.) "x = std::max({}, x);" does have a certain charm, and
    can be helpful when the type of 'x' is changing. However, in general
    it is clearer to write zero explicitly.
---
 accountvalue.cpp |  30 ++++++-------
 gpt_specamt.cpp  |   2 +-
 group_values.cpp |   2 +-
 ihs_acctval.cpp  | 108 +++++++++++++++++++++++-----------------------
 ihs_avdebug.cpp  |   2 +-
 ihs_avmly.cpp    | 128 +++++++++++++++++++++++++++----------------------------
 ihs_avsolve.cpp  |   6 +--
 ihs_avstrtgy.cpp |   2 +-
 ihs_basicval.cpp |   4 +-
 solve.cpp        |   4 +-
 10 files changed, 144 insertions(+), 144 deletions(-)

diff --git a/accountvalue.cpp b/accountvalue.cpp
index b17d078..69dd868 100644
--- a/accountvalue.cpp
+++ b/accountvalue.cpp
@@ -228,13 +228,13 @@ void AccountValue::RunOneCell(mcenum_run_basis TheBasis)
     LapseMonth       = 0;
     LapseYear        = 0;
 
-    TaxBasis         = {};
+    TaxBasis         = C0;
 
-    MaxLoan          = {};
-    RegLnBal         = {};
-    PrfLnBal         = {};
-    AVRegLn          = {};
-    AVPrfLn          = {};
+    MaxLoan          = C0;
+    RegLnBal         = C0;
+    PrfLnBal         = C0;
+    AVRegLn          = C0;
+    AVPrfLn          = C0;
 
     // 'InforceAVGenAcct' is unloaned only; this branch wasn't
     // designed to allow inforce loans.
@@ -323,8 +323,8 @@ void AccountValue::DoYear
 
     YearsCorridorFactor = BasicValues::GetCorridorFactor()[Year];
 
-    GrossPmts  .assign(12, {});
-    NetPmts    .assign(12, {});
+    GrossPmts  .assign(12, C0);
+    NetPmts    .assign(12, C0);
 
     // IHS !! Strategy here?
 
@@ -433,7 +433,7 @@ inline int AccountValue::MonthsToNextModalPmtDate() const
 // Set specamt according to selected strategy, in every year.
 void AccountValue::PerformSpecAmtStrategy()
 {
-    currency SA {};
+    currency SA = C0;
     switch(yare_input_.SpecifiedAmountStrategy[0])
         {
         case mce_sa_input_scalar:
@@ -758,7 +758,7 @@ void AccountValue::TxSetDeathBft()
             // Option 2: specamt plus AV, or corridor times AV if greater.
             // Negative AV doesn't decrease death benefit.
             deathbft = std::max
-                (ActualSpecAmt + std::max({}, AV)
+                (ActualSpecAmt + std::max(C0, AV)
                 ,corr
                 );
             break;
@@ -792,7 +792,7 @@ void AccountValue::TxSetCoiCharge()
 
 void AccountValue::TxSetRiderDed()
 {
-    WpCharge = {};
+    WpCharge = C0;
     if(haswp)
         {
         WpCharge = currency
@@ -802,7 +802,7 @@ void AccountValue::TxSetRiderDed()
             );
         }
 
-    AdbCharge = {};
+    AdbCharge = C0;
     if(hasadb)
         {
         AdbCharge = currency(YearsAdbRate * std::min(500000.0, 
ActualSpecAmt.d()));
@@ -883,7 +883,7 @@ void AccountValue::TxTakeWD()
     // Impose minimum amount (if nonzero) on withdrawals.
     if(wd < MinWD)
         {
-        wd = {};
+        wd = C0;
         }
 
     // Impose maximum amount.
@@ -1059,9 +1059,9 @@ double AccountValue::GetCurtateNetCoiChargeInforce() const
 double AccountValue::GetProjectedCoiChargeInforce() const
     {return 0.0;}
 currency AccountValue::GetSepAcctAssetsInforce() const
-    {return {};}
+    {return C0;}
 currency AccountValue::IncrementBOM(int, int, double)
-    {return {};}
+    {return C0;}
 void   AccountValue::IncrementEOM(int, int, currency, currency)
     {return;}
 void   AccountValue::IncrementEOY(int)
diff --git a/gpt_specamt.cpp b/gpt_specamt.cpp
index e5b14e3..c21b7a3 100644
--- a/gpt_specamt.cpp
+++ b/gpt_specamt.cpp
@@ -92,7 +92,7 @@ class FindSpecAmt
         ,Premium         {a_Premium}
         ,NetPmtFactorTgt {a_NetPmtFactorTgt}
         ,NetPmtFactorExc {a_NetPmtFactorExc}
-        ,SpecAmt         {}
+        ,SpecAmt         {C0}
         {
         }
     double operator()(double a_Trial)
diff --git a/group_values.cpp b/group_values.cpp
index 6e8fbd4..130a7ef 100644
--- a/group_values.cpp
+++ b/group_values.cpp
@@ -419,7 +419,7 @@ census_run_result run_census_in_parallel::operator()
                     ;
             for(int month = inforce_month; month < 12; ++month)
                 {
-                currency assets {};
+                currency assets = C0;
 
                 // Get total case assets prior to interest crediting because
                 // those assets may determine the M&E charge.
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index f356eb9..aba0680 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -109,18 +109,18 @@ AccountValue::AccountValue(Input const& input)
     // Explicitly initialize antediluvian members. It's generally
     // better to do this in the initializer-list, but here they can
     // all be kept together.
-    LapseMonth               = {};         // Antediluvian.
-    LapseYear                = {};         // Antediluvian.
-    AVUnloaned               = {};         // Antediluvian.
-    pmt                      = {};         // Antediluvian.
+    LapseMonth               = 0;          // Antediluvian.
+    LapseYear                = 0;          // Antediluvian.
+    AVUnloaned               = C0;         // Antediluvian.
+    pmt                      = C0;         // Antediluvian.
     pmt_mode                 = mce_annual; // Antediluvian.
-    ModeIndex                = {};         // Antediluvian.
-    wd                       = {};         // Antediluvian.
-    mlyguarv                 = {};         // Antediluvian.
-    deathbft                 = {};         // Antediluvian.
+    ModeIndex                = 0;          // Antediluvian.
+    wd                       = C0;         // Antediluvian.
+    mlyguarv                 = 0.0;        // Antediluvian.
+    deathbft                 = C0;         // Antediluvian.
     haswp                    = false;      // Antediluvian.
     hasadb                   = false;      // Antediluvian.
-    mlydedtonextmodalpmtdate = {}   ;      // Antediluvian.
+    mlydedtonextmodalpmtdate = C0   ;      // Antediluvian.
 
     set_list_bill_year_and_month();
 
@@ -215,7 +215,7 @@ Then run other bases.
 // this rather expensive function.
 void AccountValue::SetGuarPrem()
 {
-    GuarPremium = {};
+    GuarPremium = C0;
     if(BasicValues::IsSubjectToIllustrationReg())
         {
         GuarPremium = SolveGuarPremium();
@@ -389,7 +389,7 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
     // TODO ?? TAXATION !! Shouldn't we increase initial SA if contract in 
corridor at issue?
     OldDB = OldSA;
 
-    SurrChg_.assign(BasicValues::GetLength(), {});
+    SurrChg_.assign(BasicValues::GetLength(), C0);
 
     // TAXATION !! Input::InforceAnnualTargetPremium should be used here.
     double annual_target_premium = GetModalTgtPrem
@@ -521,7 +521,7 @@ void AccountValue::SetInitialValues()
     Month                 = InforceMonth;
     CoordinateCounters();
 
-    DB7702A               = {};  // TODO ?? TAXATION !! This seems silly.
+    DB7702A               = C0;  // TODO ?? TAXATION !! This seems silly.
 
     AVRegLn               = round_minutiae().c(InforceAVRegLn);
     AVPrfLn               = round_minutiae().c(InforceAVPrfLn);
@@ -562,28 +562,28 @@ void AccountValue::SetInitialValues()
             ;
         }
 
-    MaxLoan                     = {};
+    MaxLoan                     = C0;
 
-    GenAcctIntCred              = {};
-    SepAcctIntCred              = {};
-    RegLnIntCred                = {};
-    PrfLnIntCred                = {};
+    GenAcctIntCred              = C0;
+    SepAcctIntCred              = C0;
+    RegLnIntCred                = C0;
+    PrfLnIntCred                = C0;
 
-    MaxWD                       = {};
-    GrossWD                     = {};
-    NetWD                       = {};
+    MaxWD                       = C0;
+    GrossWD                     = C0;
+    NetWD                       = C0;
 
     CumPmts                     = InforceCumPmts;
     TaxBasis                    = InforceTaxBasis;
-    YearlyTaxBasis.assign(BasicValues::GetLength(), {});
-    MlyNoLapsePrem              = {};
+    YearlyTaxBasis.assign(BasicValues::GetLength(), C0);
+    MlyNoLapsePrem              = C0;
     CumNoLapsePrem              = InforceCumNoLapsePrem;
 
     // Initialize all elements of this vector to 'false'. Then, when
     // the no-lapse criteria fail to be met, future values are right.
     YearlyNoLapseActive.assign(BasicValues::GetLength(), false);
-    loan_ullage_       .assign(BasicValues::GetLength(), {});
-    withdrawal_ullage_ .assign(BasicValues::GetLength(), {});
+    loan_ullage_       .assign(BasicValues::GetLength(), C0);
+    withdrawal_ullage_ .assign(BasicValues::GetLength(), C0);
     NoLapseActive               = true;
     if(NoLapseDboLvlOnly && mce_option1 != DeathBfts_->dbopt()[0])
         {
@@ -599,7 +599,7 @@ void AccountValue::SetInitialValues()
 
     database().query_into(DB_TermCanLapse       , TermCanLapse);
     TermRiderActive             = true;
-    TermDB                      = {};
+    TermDB                      = C0;
 
     ItLapsed                    = false;
 
@@ -633,10 +633,10 @@ void AccountValue::SetInitialValues()
             }
         }
 
-    CoiCharge                   = {};
-    RiderCharges                = {};
-    NetCoiCharge                = {};
-    MlyDed                      = {};
+    CoiCharge                   = C0;
+    RiderCharges                = C0;
+    NetCoiCharge                = C0;
+    MlyDed                      = C0;
     CumulativeSalesLoad         = 
round_minutiae().c(yare_input_.InforceCumulativeSalesLoad);
 
     database().query_into(DB_ExpRatCoiRetention, CoiRetentionRate);
@@ -692,7 +692,7 @@ currency AccountValue::IncrementBOM
         {
         // Return value is total assets. After the policy has lapsed or
         // matured, there are no assets.
-        return {};
+        return C0;
         }
 
     // Paranoid check.
@@ -764,8 +764,8 @@ void AccountValue::IncrementEOM
 
     // Save arguments, constraining their values to be nonnegative,
     // for calculating banded and tiered quantities.
-    AssetsPostBom  = std::max({}, assets_post_bom  );
-    CumPmtsPostBom = std::max({}, cum_pmts_post_bom);
+    AssetsPostBom  = std::max(C0, assets_post_bom  );
+    CumPmtsPostBom = std::max(C0, cum_pmts_post_bom);
 
     DoMonthCR();
 }
@@ -812,29 +812,29 @@ void AccountValue::InitializeYear()
         Irc7702A_->UpdateBOY7702A(Year);
         }
 
-    MonthsPolicyFees            = {};
-    SpecAmtLoad                 = {};
+    MonthsPolicyFees            = C0;
+    SpecAmtLoad                 = C0;
 
-    AssetsPostBom               = {};
-    CumPmtsPostBom              = {};
-    SepAcctLoad                 = {};
+    AssetsPostBom               = C0;
+    CumPmtsPostBom              = C0;
+    SepAcctLoad                 = C0;
 
-    YearsTotalCoiCharge         = {};
-    YearsTotalRiderCharges      = {};
+    YearsTotalCoiCharge         = C0;
+    YearsTotalRiderCharges      = C0;
     YearsAVRelOnDeath           = 0.0;
     YearsLoanRepaidOnDeath      = 0.0;
     YearsGrossClaims            = 0.0;
     YearsDeathProceeds          = 0.0;
     YearsNetClaims              = 0.0;
-    YearsTotalNetIntCredited    = {};
-    YearsTotalGrossIntCredited  = {};
-    YearsTotalLoanIntAccrued    = {};
+    YearsTotalNetIntCredited    = C0;
+    YearsTotalGrossIntCredited  = C0;
+    YearsTotalLoanIntAccrued    = C0;
     YearsTotalNetCoiCharge      = 0.0;
-    YearsTotalPolicyFee         = {};
+    YearsTotalPolicyFee         = C0;
     YearsTotalDacTaxLoad        = 0.0;
-    YearsTotalSpecAmtLoad       = {};
-    YearsTotalSepAcctLoad       = {};
-    YearsTotalGptForceout       = {};
+    YearsTotalSpecAmtLoad       = C0;
+    YearsTotalSepAcctLoad       = C0;
+    YearsTotalGptForceout       = C0;
 
     NextYearsProjectedCoiCharge = 0.0;
 
@@ -845,12 +845,12 @@ void AccountValue::InitializeYear()
     // variable in each function might have sufficed, except that this
     // quantity is used in the optional monthly detail report. Its
     // value depends on the maximum loan, so it cannot be known here.
-    ActualLoan                  = {};
+    ActualLoan                  = C0;
 
-    GrossPmts   .assign(12, {});
-    EeGrossPmts .assign(12, {});
-    ErGrossPmts .assign(12, {});
-    NetPmts     .assign(12, {});
+    GrossPmts   .assign(12, C0);
+    EeGrossPmts .assign(12, C0);
+    ErGrossPmts .assign(12, C0);
+    NetPmts     .assign(12, C0);
 
     InitializeSpecAmt();
 }
@@ -1025,7 +1025,7 @@ currency AccountValue::CSVBoost() const
         + yare_input_.CashValueEnhancementRate[Year]
         ;
     LMI_ASSERT(0.0 <= z);
-    return round_minutiae().c(z * std::max({}, TotalAccountValue()));
+    return round_minutiae().c(z * std::max(C0, TotalAccountValue()));
 }
 
 //============================================================================
@@ -1182,7 +1182,7 @@ void AccountValue::FinalizeYear()
 
     if(!Solving)
         {
-        csv_net = std::max(csv_net, {});
+        csv_net = std::max(csv_net, C0);
         }
 
     if(Solving)
@@ -1465,7 +1465,7 @@ currency AccountValue::GetSepAcctAssetsInforce() const
 {
     if(ItLapsed || BasicValues::GetLength() <= Year)
         {
-        return {};
+        return C0;
         }
 
     return round_minutiae().c(SepAcctValueAfterDeduction * 
partial_mortality_lx()[Year]);
diff --git a/ihs_avdebug.cpp b/ihs_avdebug.cpp
index 4dee176..595cfee 100644
--- a/ihs_avdebug.cpp
+++ b/ihs_avdebug.cpp
@@ -419,7 +419,7 @@ void AccountValue::DebugPrint()
     SetMonthlyDetail(eCumNoLapsePrem     ,CumNoLapsePrem                   );
     SetMonthlyDetail(eNoLapseActive      ,NoLapseActive                    );
     SetMonthlyDetail(eEOMAV              ,TotalAccountValue()              );
-    SetMonthlyDetail(eHMValue            ,std::max(HoneymoonValue, {})     );
+    SetMonthlyDetail(eHMValue            ,std::max(HoneymoonValue, C0)     );
     SetMonthlyDetail(eSurrChg            ,SurrChg()                        );
 
 // TODO ?? Unfortunately duplicated from AccountValue::FinalizeYear().
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index c95f930..d831b96 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -130,8 +130,8 @@ void AccountValue::DoMonthDR()
         ,CashValueFor7702().d()
         );
 
-    NetPmts  [Month] = {}; // TODO ?? expunge as being unnecessary
-    GrossPmts[Month] = {}; // TODO ?? expunge as being unnecessary
+    NetPmts  [Month] = C0; // TODO ?? expunge as being unnecessary
+    GrossPmts[Month] = C0; // TODO ?? expunge as being unnecessary
     TxExch1035();
     // TODO ?? TAXATION !! Is this where spec amt should be increased by GPT?
 
@@ -196,7 +196,7 @@ void AccountValue::DoMonthDR()
             );
         }
 
-    currency gross_1035 {};
+    currency gross_1035 = C0;
     if(0 == Year && 0 == Month)
         {
         gross_1035 = External1035Amount + Internal1035Amount;
@@ -292,7 +292,7 @@ void AccountValue::process_payment(currency payment)
     LMI_ASSERT(C0 <= EeGrossPmts[Month]);
     LMI_ASSERT(C0 <= ErGrossPmts[Month]);
 
-    currency gross_1035 {};
+    currency gross_1035 = C0;
     if(0 == Year && 0 == Month)
         {
         gross_1035 = External1035Amount + Internal1035Amount;
@@ -438,8 +438,8 @@ void AccountValue::DecrementAVProportionally(currency 
decrement)
 //  if(materially_equal(decrement, AVGenAcct + AVSepAcct))
     if(decrement == AVGenAcct + AVSepAcct)
         {
-        AVGenAcct = {};
-        AVSepAcct = {};
+        AVGenAcct = C0;
+        AVSepAcct = C0;
         return;
         }
 
@@ -502,8 +502,8 @@ void AccountValue::DecrementAVProgressively
 //  if(materially_equal(decrement, AVGenAcct + AVSepAcct))
     if(decrement == AVGenAcct + AVSepAcct)
         {
-        AVGenAcct = {};
-        AVSepAcct = {};
+        AVGenAcct = C0;
+        AVSepAcct = C0;
         return;
         }
 
@@ -578,7 +578,7 @@ void AccountValue::TxExch1035()
 
     // TODO ?? Assume for now that all 1035 exchanges represent ee payments.
     EeGrossPmts[Month] = GrossPmts[Month];
-    currency amount_exempt_from_premium_tax {};
+    currency amount_exempt_from_premium_tax = C0;
     if(WaivePmTxInt1035)
         {
         amount_exempt_from_premium_tax = Internal1035Amount;
@@ -594,7 +594,7 @@ void AccountValue::TxExch1035()
     LMI_ASSERT(C0 == AVSepAcct);
     process_payment(NetPmts[Month]);
 
-    DBReflectingCorr = {};
+    DBReflectingCorr = C0;
     TxSetDeathBft();
     TxSetTermAmt();
     // TODO ?? TAXATION !! Should 1035 exchanges be handled somewhere else?
@@ -610,7 +610,7 @@ void AccountValue::TxExch1035()
 
     if(HoneymoonActive)
         {
-        HoneymoonValue += std::max({}, GrossPmts[Month]);
+        HoneymoonValue += std::max(C0, GrossPmts[Month]);
         }
 
     CumPmts += GrossPmts[Month];
@@ -819,7 +819,7 @@ void AccountValue::ChangeSupplAmtBy(currency delta)
 
     TermSpecAmt = std::max
         (TermSpecAmt
-        ,{} // No minimum other than zero is defined.
+        ,C0 // No minimum other than zero is defined.
         );
     TermSpecAmt = round_specamt().c(TermSpecAmt); // already rounded?
     // At least for now, there is no effect on surrender charges.
@@ -837,7 +837,7 @@ void AccountValue::ChangeSupplAmtBy(currency delta)
 //============================================================================
 void AccountValue::InitializeMonth()
 {
-    GptForceout       = {};
+    GptForceout       = C0;
     premium_load_     = 0.0;
     sales_load_       = 0.0;
     premium_tax_load_ = 0.0;
@@ -910,18 +910,18 @@ void AccountValue::TxOptionChange()
                 {
                 if(mce_option2 == old_option)
                     {
-                    ChangeSpecAmtBy(std::max({}, TotalAccountValue()));
+                    ChangeSpecAmtBy(std::max(C0, TotalAccountValue()));
                     }
                 else if(mce_rop == old_option)
                     {
-                    ChangeSpecAmtBy(std::max({}, CumPmts));
+                    ChangeSpecAmtBy(std::max(C0, CumPmts));
                     }
                 else if(mce_mdb == old_option)
                     {
                     // Do nothing. An argument could be made for this
                     // alternative:
                     //   TxSetDeathBft(); // update DBReflectingCorr
-                    //   ChangeSpecAmtBy(std::max({}, DBReflectingCorr));
+                    //   ChangeSpecAmtBy(std::max(C0, DBReflectingCorr));
                     // but that takes more work and is not clearly
                     // preferable.
                     }
@@ -941,7 +941,7 @@ void AccountValue::TxOptionChange()
         case mce_option2:
             if(OptChgCanDecrSA)
                 {
-                ChangeSpecAmtBy(-std::max({}, TotalAccountValue()));
+                ChangeSpecAmtBy(-std::max(C0, TotalAccountValue()));
                 }
             else
                 {
@@ -951,7 +951,7 @@ void AccountValue::TxOptionChange()
         case mce_rop:
             if(OptChgCanDecrSA)
                 {
-                ChangeSpecAmtBy(-std::max({}, CumPmts));
+                ChangeSpecAmtBy(-std::max(C0, CumPmts));
                 }
             else
                 {
@@ -985,7 +985,7 @@ void AccountValue::TxSpecAmtChange()
 // > post-1035 exchange calculation of the seven pay will have a death benefit
 // > amount to base its calculations on.
 #if 1
-        ChangeSpecAmtBy({});
+        ChangeSpecAmtBy(C0);
 #else // 0
         // TODO ?? Changing specamt by zero is absurd. The following
         // commented-out alternative seems to do the same thing as
@@ -1226,7 +1226,7 @@ void AccountValue::TxAscertainDesiredPayment()
 //  LMI_ASSERT(materially_equal(GrossPmts[Month], EeGrossPmts[Month] + 
ErGrossPmts[Month]));
     LMI_ASSERT(GrossPmts[Month] == EeGrossPmts[Month] + ErGrossPmts[Month]);
 
-    currency eepmt {};
+    currency eepmt = C0;
     if(ee_pay_this_month)
         {
         eepmt = PerformEePmtStrategy();
@@ -1241,7 +1241,7 @@ void AccountValue::TxAscertainDesiredPayment()
         GrossPmts  [Month] += eepmt;
         }
 
-    currency erpmt {};
+    currency erpmt = C0;
     if(er_pay_this_month)
         {
         erpmt = PerformErPmtStrategy();
@@ -1332,7 +1332,7 @@ void AccountValue::TxLimitPayment(double a_maxpmt)
 
     if(mce_reduce_prem == yare_input_.AvoidMecMethod && 
!Irc7702A_->IsMecAlready())
         {
-        currency gross_1035 {};
+        currency gross_1035 = C0;
         if(0 == Year && 0 == Month)
             {
             gross_1035 = External1035Amount + Internal1035Amount;
@@ -1433,7 +1433,7 @@ void AccountValue::TxAcceptPayment(currency a_pmt)
     LMI_ASSERT(C0 <= a_pmt);
     // Internal 1035 exchanges may be exempt from premium tax; they're
     // handled elsewhere, so here the exempt amount is always zero.
-    currency actual_load = GetPremLoad(a_pmt, {});
+    currency actual_load = GetPremLoad(a_pmt, C0);
     currency net_pmt = a_pmt - actual_load;
     LMI_ASSERT(C0 <= net_pmt);
     NetPmts[Month] += net_pmt;
@@ -1451,7 +1451,7 @@ void AccountValue::TxAcceptPayment(currency a_pmt)
 
     if(HoneymoonActive)
         {
-        HoneymoonValue += std::max({}, a_pmt);
+        HoneymoonValue += std::max(C0, a_pmt);
         }
 
     CumPmts += a_pmt;
@@ -1500,12 +1500,12 @@ currency AccountValue::GetPremLoad
     else if(UnusedTargetPrem < a_pmt)
         {
         excess_portion = a_pmt - UnusedTargetPrem;
-        UnusedTargetPrem = {};
+        UnusedTargetPrem = C0;
         }
     // All target.
     else
         {
-        excess_portion = {};
+        excess_portion = C0;
         UnusedTargetPrem -= a_pmt;
         }
     currency target_portion = a_pmt - excess_portion;
@@ -1691,7 +1691,7 @@ void AccountValue::TxSetDeathBft()
         case mce_option2:
             {
             // Negative AV doesn't decrease death benefit.
-            DBIgnoringCorr = ActualSpecAmt + std::max({}, TotalAccountValue());
+            DBIgnoringCorr = ActualSpecAmt + std::max(C0, TotalAccountValue());
             DB7702A        = ActualSpecAmt;
             }
             break;
@@ -1700,8 +1700,8 @@ void AccountValue::TxSetDeathBft()
             // SA + sum of premiums less withdrawals, but not < SA;
             // i.e., ignore 'CumPmts' if it is less than zero, as it
             // easily can be, e.g., if WDs are not limited to basis.
-            DBIgnoringCorr = ActualSpecAmt + std::max({}, CumPmts);
-            DB7702A        = ActualSpecAmt + std::max({}, CumPmts);
+            DBIgnoringCorr = ActualSpecAmt + std::max(C0, CumPmts);
+            DB7702A        = ActualSpecAmt + std::max(C0, CumPmts);
             }
             break;
         case mce_mdb:
@@ -1709,8 +1709,8 @@ void AccountValue::TxSetDeathBft()
             // Specamt is a floor under DB (and therefore zero here)
             // because this option defines the DB as the minimum
             // required by the corridor (but not less than zero).
-            DBIgnoringCorr = {};
-            DB7702A        = {};
+            DBIgnoringCorr = C0;
+            DB7702A        = C0;
             }
             break;
         }
@@ -1720,7 +1720,7 @@ void AccountValue::TxSetDeathBft()
     // surrender charge must be subtracted, increasing the account value.
     currency cash_value_for_corridor =
           TotalAccountValue()
-        - std::min({}, SurrChg())
+        - std::min(C0, SurrChg())
         + GetRefundableSalesLoad()
 //        + std::max(0.0, ExpRatReserve) // This would be added if it existed.
         ;
@@ -1732,7 +1732,7 @@ void AccountValue::TxSetDeathBft()
 
     DBReflectingCorr = std::max
         (DBIgnoringCorr
-        ,round_death_benefit().c(YearsCorridorFactor * std::max({}, 
cash_value_for_corridor))
+        ,round_death_benefit().c(YearsCorridorFactor * std::max(C0, 
cash_value_for_corridor))
         );
     DBReflectingCorr = round_death_benefit().c(DBReflectingCorr); // already 
rounded?
     LMI_ASSERT(C0 <= DBReflectingCorr);
@@ -1746,7 +1746,7 @@ void AccountValue::TxSetDeathBft()
         ,   (
                 YearsCorridorFactor
             *   (   Dcv
-                -   std::min({}, SurrChg()).d()
+                -   std::min(C0, SurrChg()).d()
                 +   GetRefundableSalesLoad().d()
 //                +   std::max(0.0, ExpRatReserve) // This would be added if 
it existed.
                 )
@@ -1781,7 +1781,7 @@ void AccountValue::TxSetTermAmt()
         return;
         }
 
-    TermDB = std::max({}, TermSpecAmt + DBIgnoringCorr - DBReflectingCorr);
+    TermDB = std::max(C0, TermSpecAmt + DBIgnoringCorr - DBReflectingCorr);
     TermDB = round_death_benefit().c(TermDB); // already rounded?
 }
 
@@ -1812,8 +1812,8 @@ void AccountValue::EndTermRider(bool convert)
         {
         ChangeSpecAmtBy(TermSpecAmt);
         }
-    TermSpecAmt = {};
-    TermDB      = {};
+    TermSpecAmt = C0;
+    TermDB      = C0;
     // Carry the new term spec amt forward into all future years.
     for(int j = Year; j < BasicValues::GetLength(); ++j)
         {
@@ -1892,7 +1892,7 @@ void AccountValue::TxSetCoiCharge()
 
 void AccountValue::TxSetRiderDed()
 {
-    AdbCharge = {};
+    AdbCharge = C0;
     if(yare_input_.AccidentalDeathBenefit)
         {
         AdbCharge = round_rider_charges().c
@@ -1900,7 +1900,7 @@ void AccountValue::TxSetRiderDed()
             );
         }
 
-    SpouseRiderCharge = {};
+    SpouseRiderCharge = C0;
     if(yare_input_.SpouseRider)
         {
         SpouseRiderCharge = round_rider_charges().c
@@ -1908,7 +1908,7 @@ void AccountValue::TxSetRiderDed()
             );
         }
 
-    ChildRiderCharge = {};
+    ChildRiderCharge = C0;
     if(yare_input_.ChildRider)
         {
         ChildRiderCharge = round_rider_charges().c
@@ -1916,7 +1916,7 @@ void AccountValue::TxSetRiderDed()
             );
         }
 
-    TermCharge    = {};
+    TermCharge    = C0;
     DcvTermCharge = 0.0;
     if(TermRiderActive)
         {
@@ -1930,7 +1930,7 @@ void AccountValue::TxSetRiderDed()
         DcvTermCharge = YearsDcvCoiRate * TermDB * DBDiscountRate[Year];
         }
 
-    WpCharge    = {};
+    WpCharge    = C0;
     DcvWpCharge = 0.0;
     if(yare_input_.WaiverOfPremiumBenefit)
         {
@@ -1985,7 +1985,7 @@ void AccountValue::TxDoMlyDed()
     if(TermRiderActive && TermCanLapse && (AVGenAcct + AVSepAcct - CoiCharge) 
< TermCharge)
         {
         EndTermRider(false);
-        TermCharge = {};
+        TermCharge = C0;
         }
 
     // 'Simple' riders are the same for AV and DCV.
@@ -2220,7 +2220,7 @@ void AccountValue::TxCreditInt()
 {
     ApplyDynamicMandE(AssetsPostBom);
 
-    currency notional_sep_acct_charge {};
+    currency notional_sep_acct_charge = C0;
 
     // SOMEDAY !! This should be done in the interest-rate class.
     double gross_sep_acct_rate = i_upper_12_over_12_from_i<double>()
@@ -2241,7 +2241,7 @@ void AccountValue::TxCreditInt()
         }
     else
         {
-        SepAcctIntCred = {};
+        SepAcctIntCred = C0;
         }
 
     if(C0 < AVGenAcct)
@@ -2265,7 +2265,7 @@ void AccountValue::TxCreditInt()
         }
     else
         {
-        GenAcctIntCred = {};
+        GenAcctIntCred = C0;
         }
 
     LMI_ASSERT(0.0 <= Dcv);
@@ -2296,8 +2296,8 @@ void AccountValue::TxLoanInt()
 {
     // Reinitialize to zero before potential early exit, to sweep away
     // any leftover values (e.g., after a loan has been paid off).
-    RegLnIntCred = {};
-    PrfLnIntCred = {};
+    RegLnIntCred = C0;
+    PrfLnIntCred = C0;
 
     // Nothing more to do if there's no loan outstanding.
     if(C0 == RegLnBal && C0 == PrfLnBal)
@@ -2407,7 +2407,7 @@ void AccountValue::TxTakeWD()
         return;
         }
 
-    GrossWD = {};
+    GrossWD = C0;
     RequestedWD = Outlay_->withdrawals()[Year];
 
     if(Debugging || C0 != RequestedWD)
@@ -2415,12 +2415,12 @@ void AccountValue::TxTakeWD()
         SetMaxWD();
         }
 
-    NetWD = {};
+    NetWD = C0;
 
     // Nothing more to do if no withdrawal requested.
     if(C0 == RequestedWD)
         {
-        withdrawal_ullage_[Year] = {};
+        withdrawal_ullage_[Year] = C0;
 // This seems wrong. If we're changing something that's invariant among
 // bases, why do we change it for each basis?
 // TODO ?? Shouldn't this be moved to FinalizeMonth()?
@@ -2434,7 +2434,7 @@ void AccountValue::TxTakeWD()
 
     if(Solving)
         {
-        withdrawal_ullage_[Year] = std::max({}, RequestedWD - MaxWD);
+        withdrawal_ullage_[Year] = std::max(C0, RequestedWD - MaxWD);
         }
 
     if(Solving || mce_run_gen_curr_sep_full == RunBasis_)
@@ -2458,8 +2458,8 @@ void AccountValue::TxTakeWD()
     // Impose minimum amount on withdrawals.
     if(RequestedWD < MinWD)
         {
-        withdrawal_ullage_[Year] = {};
-        NetWD = {};
+        withdrawal_ullage_[Year] = C0;
+        NetWD = C0;
         }
 // TODO ?? If WD zero, skip some steps? Cannot simply return in this case
 // because user may prefer to shift to loans.
@@ -2482,8 +2482,8 @@ void AccountValue::TxTakeWD()
         // TODO ?? Should RequestedWD be constrained by MaxWD and MinWD here?
         if(C0 == TaxBasis || std::min(TaxBasis, RequestedWD) < MinWD) // All 
loan
             {
-            withdrawal_ullage_[Year] = {};
-            NetWD = {};
+            withdrawal_ullage_[Year] = C0;
+            NetWD = C0;
             }
         else if(NetWD < TaxBasis) // All WD
             {
@@ -2583,7 +2583,7 @@ void AccountValue::TxTakeWD()
         LMI_ASSERT(AVPrfLn == PrfLnBal);
         LMI_ASSERT(av == AVGenAcct + AVSepAcct);
         currency free_wd = round_withdrawal().c(FreeWDProportion[Year] * av);
-        non_free_wd = std::max({}, GrossWD - free_wd);
+        non_free_wd = std::max(C0, GrossWD - free_wd);
         }
     double partial_surrchg = non_free_wd * surrchg_proportion;
     GrossWD += round_withdrawal().c(partial_surrchg);
@@ -2690,7 +2690,7 @@ void AccountValue::SetMaxLoan()
           (AVGenAcct + AVSepAcct).d() * MaxLoanAVMult
         + (AVRegLn + AVPrfLn).d()
         - anticipated_deduction(MaxLoanDed_).d()
-        - std::max({}, SurrChg()).d()
+        - std::max(C0, SurrChg()).d()
         ;
 
     // Illustrations generally permit loans only on anniversary.
@@ -2764,7 +2764,7 @@ void AccountValue::TxTakeLoan()
     // Nothing more to do if no loan requested.
     if(RequestedLoan <= C0)
         {
-        loan_ullage_[Year] = {};
+        loan_ullage_[Year] = C0;
         return;
         }
 
@@ -2776,12 +2776,12 @@ void AccountValue::TxTakeLoan()
     if(Solving)
         {
         ActualLoan = RequestedLoan;
-        loan_ullage_[Year] = std::max({}, RequestedLoan - max_loan_increment);
+        loan_ullage_[Year] = std::max(C0, RequestedLoan - max_loan_increment);
         }
     else
         {
         ActualLoan = std::min(max_loan_increment, RequestedLoan);
-        ActualLoan = std::max(ActualLoan, {});
+        ActualLoan = std::max(ActualLoan, C0);
         // TODO ?? Shouldn't this happen in FinalizeMonth()?
         InvariantValues().NewCashLoan[Year] = ActualLoan.d();
         }
@@ -2861,7 +2861,7 @@ void AccountValue::TxTestLapse()
         ;
     if(!LapseIgnoresSurrChg)
         {
-        lapse_test_csv -= std::max({}, SurrChg());
+        lapse_test_csv -= std::max(C0, SurrChg());
         }
     lapse_test_csv = std::max(lapse_test_csv, HoneymoonValue);
 
@@ -2935,8 +2935,8 @@ void AccountValue::TxTestLapse()
         {
         if(NoLapseActive && lapse_test_csv < C0)
             {
-            AVGenAcct = {};
-            AVSepAcct = {};
+            AVGenAcct = C0;
+            AVSepAcct = C0;
             // TODO ?? Can't this be done elsewhere?
             VariantValues().CSVNet[Year] = 0.0;
             }
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 49a6327..f9b8928 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -183,7 +183,7 @@ currency AccountValue::SolveTest(currency a_CandidateValue)
         ,0
         );
     LMI_ASSERT(0 <= no_lapse_dur);
-    currency most_negative_csv {};
+    currency most_negative_csv = C0;
     if(no_lapse_dur < SolveTargetDuration_)
         {
         most_negative_csv = currency
@@ -292,7 +292,7 @@ currency AccountValue::SolveGuarPremium()
     // Store original er premiums for later restoration.
     std::vector<currency> stored = Outlay_->er_modal_premiums();
     // Zero out er premiums and solve for ee premiums only.
-    Outlay_->set_er_modal_premiums({}, 0, BasicValues::GetLength());
+    Outlay_->set_er_modal_premiums(C0, 0, BasicValues::GetLength());
 
     bool temp_solving     = Solving;
     Solving               = true;
@@ -304,7 +304,7 @@ currency AccountValue::SolveGuarPremium()
         ,0
         ,BasicValues::GetLength()
         ,mce_solve_for_endt
-        ,{}
+        ,C0
         ,BasicValues::GetLength()
         ,mce_gen_guar
         ,mce_sep_full
diff --git a/ihs_avstrtgy.cpp b/ihs_avstrtgy.cpp
index e7c2306..21ca9c1 100644
--- a/ihs_avstrtgy.cpp
+++ b/ihs_avstrtgy.cpp
@@ -174,7 +174,7 @@ void AccountValue::PerformSupplAmtStrategy()
 {
     for(int j = 0; j < BasicValues::Length; ++j)
         {
-        currency m {}; // No minimum other than zero is defined.
+        currency m = C0; // No minimum other than zero is defined.
         currency explicit_value = DeathBfts_->supplamt()[j];
         mcenum_sa_strategy strategy = 
yare_input_.SupplementalAmountStrategy[j];
         currency z = CalculateSpecAmtFromStrategy(j, 0, explicit_value, 
strategy);
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 8300489..ae2b5c6 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -242,7 +242,7 @@ void BasicValues::Init()
     // by GPTServerInit(); the value assigned here is overridden by a
     // downstream call to Irc7702::Initialize7702(). TAXATION !! So
     // eliminate the member when it becomes unnecessary.
-    InitialTargetPremium = {};
+    InitialTargetPremium = C0;
 
     SetMaxSurvivalDur();
     set_partial_mortality();
@@ -1606,7 +1606,7 @@ currency BasicValues::GetModalSpecAmtMlyDed(currency, 
mcenum_mode) const
         << "No maximum specified amount is defined for this product."
         << LMI_FLUSH
         ;
-    return currency {};
+    return C0;
 }
 
 /// 'Unusual' banding is one particular approach we needed to model.
diff --git a/solve.cpp b/solve.cpp
index 3668401..3087d3d 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -79,7 +79,7 @@ currency SolveTest()
     //   CSV at target duration
     //   lowest negative CSV through target duration
     //   amount of loan in excess of maximum loan through target duration
-    currency Negative {};
+    currency Negative = C0;
 
     // IHS !! Start counting only at end of no-lapse period--lmi does that 
already.
     for(int j = 0; j < ThatSolveTgtYear; ++j)
@@ -98,7 +98,7 @@ currency SolveTest()
         z = std::min(z, Negative);
     // IHS !! If SolveTgtYr within no-lapse period...see lmi.
 
-    currency y {};
+    currency y = C0;
     switch(ThatSolveTarget)
         {
         case mce_solve_for_endt:



reply via email to

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