Skip to content

Add Optional based on variantSrc::variant#806

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

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

Conversation

@franzpoeschel

@franzpoeschel franzpoeschel commented Oct 27, 2020

Copy link
Copy Markdown
Contributor

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
Comment thread include/openPMD/auxiliary/Option.hpp Outdated

@ax3l ax3l left a comment

Copy link
Copy Markdown
Member

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?

Comment thread include/openPMD/auxiliary/Option.hpp Outdated
Comment thread include/openPMD/auxiliary/Option.hpp Outdated
Comment thread include/openPMD/auxiliary/Option.hpp Outdated
Comment thread include/openPMD/auxiliary/Option.hpp Outdated
Comment thread include/openPMD/auxiliary/Option.hpp Outdated
@ax3l ax3l changed the title Optional Lite based on variantSrc::variant Add Optional based on variantSrc::variant Oct 28, 2020
Comment thread test/AuxiliaryTest.cpp Outdated

Option<int> opt;

REQUIRE_THROWS(opt.get());

@ax3l ax3l Oct 28, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ax3l ax3l Oct 29, 2020

Copy link
Copy Markdown
Member

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