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

Polyfill cetl::optional, extend the testing suite #89

Merged
merged 46 commits into from Feb 28, 2024
Merged

Conversation

pavel-kirienko
Copy link
Member

@pavel-kirienko pavel-kirienko commented Feb 9, 2024

  • Add optional and related entities such as make_optional, nullopt, in_place, etc.
  • Add type_traits.hpp.
  • Fix usage of CETL_PROJECT_VERSION in the build recipes.
  • Disable C++ extensions in CETLVaSt (they were mistakenly left enabled).
  • Add basic typelist operations to CETLVaSt that are needed for exhaustive combinatorial testing.
  • Add the CETL_NODISCARD attribute.
  • Add a useful feature to the GitHub Actions workflow: run CI jobs for all pushes where the head commit contains a hashtag with the name of the job; e.g., adding #verification to the commit message will run the verification job.

This PR is feature- and testing-complete but lacks the docs, which I am going to add next. The code is ready to be reviewed meanwhile. You may notice that the coverage reporting is odd because there are a few places where templates are not marked as instantiated while they actually are, also some branches in the comparison operators appear to be mislabeled as partially-covered.

The commit history is non-informative and should not be looked at, as it will be squashed anyway.

My next step is to finish #51 (which is blocked on cetl::optional) and then perhaps switch to #86, because there are certain similarities between optional and variant that will make it easier for me to do this part now rather than later.

@pavel-kirienko
Copy link
Member Author

Regarding the naming convention used see #85

Copy link
Member

@thirtytwobits thirtytwobits left a comment

Choose a reason for hiding this comment

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

Still reviewing but I'll flush these comments. Most important is is_nothrow_swapable is not in C++14.

.github/workflows/cetlvast.yml Show resolved Hide resolved
include/cetl/pf17/optional.hpp Outdated Show resolved Hide resolved
include/cetl/pf17/attribute.hpp Show resolved Hide resolved
include/cetl/pf17/utility.hpp Show resolved Hide resolved
include/cetl/pf17/optional.hpp Outdated Show resolved Hide resolved
include/cetl/pf17/optional.hpp Show resolved Hide resolved
@pavel-kirienko pavel-kirienko marked this pull request as ready for review February 17, 2024 17:05
@pavel-kirienko
Copy link
Member Author

Heads up: I tweaked two Doxygen settings to eliminate unhelpful warnings about undocumented enum members (well-named entities may not require explicit docs) and to automatically distribute docs to all group members to reduce doc copypasta.

Copy link

@lydia-at-amazon lydia-at-amazon left a comment

Choose a reason for hiding this comment

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

Perused the code. Looks good. Should definitely be enough to fulfill our immediate use case in Libcyphal. Approving

Copy link
Member

@thirtytwobits thirtytwobits left a comment

Choose a reason for hiding this comment

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

We're still missing an example app under cetlvast/suites/docs/examples

cetlvast/include/cetlvast/typelist.hpp Show resolved Hide resolved
include/cetl/pf17/attribute.hpp Show resolved Hide resolved
include/cetl/_helpers.hpp Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Feb 27, 2024

Copy link
Member

@thirtytwobits thirtytwobits left a comment

Choose a reason for hiding this comment

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

Please add a task to create a cetlvast/suites/docs/examples/ example for optional in the future.

@pavel-kirienko pavel-kirienko merged commit f58f00f into main Feb 28, 2024
34 checks passed
@pavel-kirienko pavel-kirienko deleted the issue8 branch February 28, 2024 10:34
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

3 participants