lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 1cfefc0 5/8: Assert post-construction invaria


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1cfefc0 5/8: Assert post-construction invariants at end of each ctor
Date: Thu, 23 Feb 2017 05:29:07 -0500 (EST)

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

    Assert post-construction invariants at end of each ctor
---
 input_sequence.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index 36e42c1..258fc36 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -117,6 +117,7 @@ InputSequence::InputSequence
         );
 
     realize_intervals();
+    assert_sane_and_ordered_partition(intervals_, years_to_maturity_);
 }
 
 /// Construct from vector: e.g, 1 1 1 2 2 --> 1[0,3); 2[3,4).
@@ -135,6 +136,7 @@ InputSequence::InputSequence(std::vector<double> const& v)
 {
     initialize_from_vector(v);
     realize_intervals();
+    assert_sane_and_ordered_partition(intervals_, years_to_maturity_);
 }
 
 /// Construct from vector: e.g, a a a b b --> a[0,3); b[3,4).
@@ -147,6 +149,7 @@ InputSequence::InputSequence(std::vector<std::string> 
const& v)
 {
     initialize_from_vector(v);
     realize_intervals();
+    assert_sane_and_ordered_partition(intervals_, years_to_maturity_);
 }
 
 namespace
@@ -307,8 +310,6 @@ std::vector<ValueInterval> const& 
InputSequence::interval_representation() const
 
 void InputSequence::realize_intervals()
 {
-    assert_sane_and_ordered_partition(intervals_, years_to_maturity_);
-
     std::vector<double>      r(years_to_maturity_);
     std::vector<std::string> s(years_to_maturity_, default_keyword_);
     number_result_  = r;



reply via email to

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