Skip to content
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

DM-30339: replace boost::any with std::any #69

Merged
merged 2 commits into from Jun 11, 2021
Merged

Conversation

mwittgen
Copy link
Contributor

@mwittgen mwittgen commented Jun 8, 2021

No description provided.

Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

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

Looks good, some suggestions for the exception handling.

src/PropertySet.cc Show resolved Hide resolved
return boost::any_cast<T>(i->second->back());
} catch (boost::bad_any_cast) {
return std::any_cast<T>(i->second->back());
} catch (std::bad_any_cast &) {
throw LSST_EXCEPT(pex::exceptions::TypeError, name);
Copy link
Member

Choose a reason for hiding this comment

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

Not related to the migration, but it might be worth adding exception chaining, to keep information about the badly cast value from being lost:

Suggested change
throw LSST_EXCEPT(pex::exceptions::TypeError, name);
std::throw_with_nested(LSST_EXCEPT(pex::exceptions::TypeError, name));

Same with other cases below.

return boost::any_cast<T>(i->second->back());
} catch (boost::bad_any_cast) {
return std::any_cast<T>(i->second->back());
} catch (std::bad_any_cast &) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
} catch (std::bad_any_cast &) {
} catch (std::bad_any_cast const&) {

Same with other cases below.

@mwittgen mwittgen merged commit e793dc4 into master Jun 11, 2021
@mwittgen mwittgen deleted the tickets/DM-30339 branch June 11, 2021 02:27
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.

None yet

2 participants