lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master a984aa65 6/6: Strengthen sanity preconditions


From: Greg Chicares
Subject: [lmi-commits] [lmi] master a984aa65 6/6: Strengthen sanity preconditions
Date: Sat, 16 Jul 2022 11:13:48 -0400 (EDT)

branch: master
commit a984aa65d424db61189f393b6743ea335d9da2eb
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Strengthen sanity preconditions
---
 datum_sequence.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/datum_sequence.cpp b/datum_sequence.cpp
index e547b36f..0a7ba75d 100644
--- a/datum_sequence.cpp
+++ b/datum_sequence.cpp
@@ -107,16 +107,13 @@ bool sequence_base::equals(sequence_base const& z) const
 /// Ensure that input is possible; throw otherwise.
 ///
 /// Input is possible iff either
-///   - keyword values are allowable, or
+///   - keyword values are allowable, and at least one is allowed, or
 ///   - numeric values are allowable.
-/// For the nonce at least, the first condition doesn't require
-/// allowed_keywords() to return a non-empty map; that can be
-/// considered as experience emerges with derived classes.
 
 void sequence_base::assert_sanity() const
 {
     LMI_ASSERT
-        (  keyword_values_are_allowable()
+        (  keyword_values_are_allowable() && !allowed_keywords().empty()
         || numeric_values_are_allowable()
         );
 }



reply via email to

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