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
hpx/util/safe_lexical_cast.hpp is added. #1270
Conversation
Some unprotected uses of boost::lexical_cast are wrapped by safe_lexical_cast.
Looks good to me |
Some default values can be derived from the surrounding code, like for instance in this case:
Could you go through the code one more time and change these uses of |
Sure. |
The code uses C++11 uniform initialization. I'm not sure if it's supported |
safe_lexical_cast
Good point! @AntonBikineev: with HPX we currently have to support older compilers not supporting all of C++11. Uniform initialization syntax is unfortunately one of those features not available to us. In your case that should be a simple fix, though, assuming the target type is default constructible. |
I'm not sure, but if get_entry_as function does make sense it might be better to move it to more appropriate header. |
I think it's fine to have it where you put it for now. |
hpx/util/safe_lexical_cast.hpp is added.
Some unprotected uses of boost::lexical_cast are wrapped by safe_lexical_cast. Issue #799.
I tried to use safe_lexical_cast where string casts to number and lexical_cast is not surrounded by try-catch block. Note that some default values should be added.