[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()
);
}
- [lmi-commits] [lmi] master updated (9effa535 -> a984aa65), Greg Chicares, 2022/07/16
- [lmi-commits] [lmi] master b2c2bea1 2/6: Write certain ctors out of line, Greg Chicares, 2022/07/16
- [lmi-commits] [lmi] master 2aeeb582 4/6: Increase concinnity, Greg Chicares, 2022/07/16
- [lmi-commits] [lmi] master 53cb60b1 5/6: Make a class abstract in a different way, Greg Chicares, 2022/07/16
- [lmi-commits] [lmi] master a984aa65 6/6: Strengthen sanity preconditions,
Greg Chicares <=
- [lmi-commits] [lmi] master 493403d0 1/6: Expunge facility for blocking keywords at run time, Greg Chicares, 2022/07/16
- [lmi-commits] [lmi] master 8c961b81 3/6: Call assert_sanity() iff appropriate, Greg Chicares, 2022/07/16