From: Morgan Deters Date: Thu, 7 Feb 2013 02:30:35 +0000 (-0500) Subject: make datatypes enumerator behavior clearer (no exceptions in normal operation) X-Git-Tag: cvc5-1.0.0~7391^2~14 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=816630a9e9e6b13f7299535a18fe87c5f8180def;p=cvc5.git make datatypes enumerator behavior clearer (no exceptions in normal operation) --- diff --git a/src/theory/datatypes/type_enumerator.h b/src/theory/datatypes/type_enumerator.h index 2a14d7fba..8ee275f70 100644 --- a/src/theory/datatypes/type_enumerator.h +++ b/src/theory/datatypes/type_enumerator.h @@ -139,11 +139,10 @@ public: DatatypesEnumerator& operator++() throw() { if(d_ctor < d_datatype.getNumConstructors()) { for(size_t a = d_datatype[d_ctor].getNumArgs(); a > 0; --a) { - try { - *++*d_argEnumerators[a - 1]; - return *this; - } catch(NoMoreValuesException&) { + if((++*d_argEnumerators[a - 1]).isFinished()) { *d_argEnumerators[a - 1] = TypeEnumerator(Node::fromExpr(d_datatype[d_ctor][a - 1].getSelector()).getType()[1]); + } else { + return *this; } }