lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master a80646a 2/2: Improve documentation


From: Greg Chicares
Subject: [lmi-commits] [lmi] master a80646a 2/2: Improve documentation
Date: Fri, 27 Jan 2017 12:12:54 +0000 (UTC)

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

    Improve documentation
---
 death_benefits.cpp |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/death_benefits.cpp b/death_benefits.cpp
index ae73b09..669c3ec 100644
--- a/death_benefits.cpp
+++ b/death_benefits.cpp
@@ -56,8 +56,15 @@ death_benefits::~death_benefits() = default;
 //============================================================================
 void death_benefits::set_specamt(double z, int from_year, int to_year)
 {
-//    std::fill_n(specamt_.begin() + from_year, to_year - from_year, z);
-    // SOMEDAY !! Can't use a standard algorithm?
+#if 0
+    // Something like this would seem preferable, but it gives
+    //   Assertion 'to_year < length_' failed.
+    // with 'make cli_selftest' due to the issue noted in the ctor.
+    LMI_ASSERT(0 <= from_year);
+    LMI_ASSERT(     from_year <= to_year);
+    LMI_ASSERT(                  to_year < length_);
+    std::fill_n(specamt_.begin() + from_year, to_year - from_year, z);
+#endif // 0
     for(int j = from_year; j < std::min(length_, to_year); ++j)
         {
         specamt_[j] = z;
@@ -67,8 +74,15 @@ void death_benefits::set_specamt(double z, int from_year, 
int to_year)
 //============================================================================
 void death_benefits::set_supplamt(double z, int from_year, int to_year)
 {
-//    std::fill_n(supplamt_.begin() + from_year, to_year - from_year, z);
-    // SOMEDAY !! Can't use a standard algorithm?
+#if 0
+    // Something like this would seem preferable, but it gives
+    //   Assertion 'to_year < length_' failed.
+    // with 'make cli_selftest' due to the issue noted in the ctor.
+    LMI_ASSERT(0 <= from_year);
+    LMI_ASSERT(     from_year <= to_year);
+    LMI_ASSERT(                  to_year < length_);
+    std::fill_n(supplamt_.begin() + from_year, to_year - from_year, z);
+#endif // 0
     for(int j = from_year; j < std::min(length_, to_year); ++j)
         {
         supplamt_[j] = z;



reply via email to

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