Skip to content

Conversation

@benjamin0
Copy link
Contributor

No description provided.

@benjamin0 benjamin0 requested a review from akleeman July 3, 2018 22:39
if (!map_contains(current_params, key)) {
std::cerr << "Error: Key `" << key << "` not found in parameters: "
<< pretty_params(current_params);
exit(EXIT_FAILURE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ from a failed assert?

Copy link
Contributor Author

@benjamin0 benjamin0 Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit() "causes normal program termination to occur" while assert(false) "causes abnormal program termination". (https://en.cppreference.com/w/cpp/utility/program/abort) Practically, I don't think it really matters here, I just thought exit() was clearer in this case since we've already checked the condition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants