-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add support for std::array parameters (Addresses issue #236) #244
Feature: Add support for std::array parameters (Addresses issue #236) #244
Conversation
…s://github.com/JeffersonLab/JANA2 into AyanRoy16-issue-236-Adding-array-in-Jparameter
inline void JParameterManager::Parse(const std::string& value, bool& val) { | ||
if (value == "0" || value =="false" || value == "off") val = false; | ||
else if (value == "1" || value == "true" || value == "on") val = true; | ||
else throw JException("'%s' not parseable as bool", value.c_str()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably fine here, but in general I'd advise against rearranging ugly logic unless it is truly necessary, particularly when parsing is involved. It's just so easy to introduce bugs or activate bugs that have been lying dormant. Particularly when our test cases are this light.
Adding array as a return type at JParameter.h .
[X] Passing existing test cases
[X] New test cases added