Skip to content

Commit aecb708

Browse files
committed
better error messages
1 parent b570f55 commit aecb708

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/validate.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// reproducable fashion. (The randomness is consistent across compilers and //
2121
// machines) //
2222
//============================================================================//
23-
// version 3.0.0 //
23+
// version 3.0.1 //
2424
// https://github.com/mzuenni/icpc-header //
2525
//============================================================================//
2626

@@ -1973,6 +1973,7 @@ class ParameterBase {
19731973

19741974
public:
19751975
std::string asString() const {
1976+
judgeAssert<std::invalid_argument>(token.has_value(), "asString(): missing arg");
19761977
return std::string(token.value());
19771978
}
19781979

@@ -1981,6 +1982,7 @@ class ParameterBase {
19811982
}
19821983

19831984
Integer asInteger() const {
1985+
judgeAssert<std::invalid_argument>(token.has_value(), "asInteger(): missing arg");
19841986
return parse<Integer>(token.value());
19851987
}
19861988

@@ -1989,6 +1991,7 @@ class ParameterBase {
19891991
}
19901992

19911993
Real asReal() const {
1994+
judgeAssert<std::invalid_argument>(token.has_value(), "asReal(): missing arg");
19921995
return parse<Real>(token.value());
19931996
}
19941997

0 commit comments

Comments
 (0)