Skip to content

Add Optional based on variantSrc::variant#806

Merged
ax3l merged 6 commits intoopenPMD:devfrom
franzpoeschel:topic-optional-lite
Oct 29, 2020
Merged

Add Optional based on variantSrc::variant#806
ax3l merged 6 commits intoopenPMD:devfrom
franzpoeschel:topic-optional-lite

Conversation

@franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented Oct 27, 2020

Adds a class template openPMD::auxiliary::Option to provide for somewhat the same functionality as C++17's std::optional and uses it in several places in the ADIOS2 backend. Close #563.

@ax3l ax3l added the internal label Oct 28, 2020
@ax3l ax3l self-assigned this Oct 28, 2020
@ax3l ax3l self-requested a review October 28, 2020 06:26
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

LGTM. Minor points added as comments.

Can you please add test coverage for openPMD::auxiliary::Option in test/AuxiliaryTest.cpp?

@ax3l ax3l changed the title Optional Lite based on variantSrc::variant Add Optional based on variantSrc::variant Oct 28, 2020

Option<int> opt;

REQUIRE_THROWS(opt.get());
Copy link
Member

@ax3l ax3l Oct 28, 2020

Choose a reason for hiding this comment

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

Copy link
Member

@ax3l ax3l Oct 29, 2020

Choose a reason for hiding this comment

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

PR: mpark/variant#76

Will push a work-around here and unify the variant include, to avoid potential ODR issues.

ax3l added 2 commits October 28, 2020 17:23
Add unit tests for `auxiliary::Option`
Enable exceptions with older GCC. See upstream PR for release
1.4.0.
@ax3l ax3l force-pushed the topic-optional-lite branch from c6d486f to 1e51f7d Compare October 29, 2020 00:23
@ax3l ax3l merged commit a75d00f into openPMD:dev Oct 29, 2020
@franzpoeschel franzpoeschel deleted the topic-optional-lite branch January 28, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internally Use optional-lite

2 participants