Skip to content

value_to supports missing elements for std::optional#807

Merged
grisumbras merged 1 commit intoboostorg:developfrom
grisumbras:feature/missing-member-optional
Jan 2, 2023
Merged

value_to supports missing elements for std::optional#807
grisumbras merged 1 commit intoboostorg:developfrom
grisumbras:feature/missing-member-optional

Conversation

@grisumbras
Copy link
Copy Markdown
Member

No description provided.

@grisumbras grisumbras force-pushed the feature/missing-member-optional branch from 595d7b1 to f0611aa Compare November 16, 2022 12:42
@cppalliance-bot
Copy link
Copy Markdown

@grisumbras grisumbras force-pushed the feature/missing-member-optional branch from f0611aa to 8f7e7c8 Compare November 16, 2022 18:59
@cppalliance-bot
Copy link
Copy Markdown

@klemens-morgenstern
Copy link
Copy Markdown

I could also use this with boost::optional - here's my use-case

https://github.com/klemens-morgenstern/requests/blob/develop/example/github-issues.hpp#L94

It's quite common in APIs, that null and non-existant are functionally the same.

I guess one could use a optional<variant<monostate, T>> if those two cases have to be distinguished.

@grisumbras
Copy link
Copy Markdown
Member Author

We probably need a special category for nullable types

@grisumbras grisumbras force-pushed the feature/missing-member-optional branch from 8f7e7c8 to 8659e7d Compare January 2, 2023 11:09
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 2, 2023

Codecov Report

Merging #807 (8659e7d) into develop (a210032) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #807   +/-   ##
========================================
  Coverage    99.01%   99.01%           
========================================
  Files           70       70           
  Lines         6883     6883           
========================================
  Hits          6815     6815           
  Misses          68       68           
Impacted Files Coverage Δ
include/boost/json/detail/value_to.hpp 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a210032...8659e7d. Read the comment docs.

@grisumbras grisumbras merged commit 8659e7d into boostorg:develop Jan 2, 2023
@grisumbras grisumbras deleted the feature/missing-member-optional branch January 2, 2023 11:38
@cppalliance-bot
Copy link
Copy Markdown

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.

3 participants