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

Make stream_to accept optional<string_view>. #597

Merged
merged 9 commits into from
Sep 2, 2022
Merged

Conversation

jtv
Copy link
Owner

@jtv jtv commented Aug 31, 2022

Fixes #596.

Supports std::optional, std::shared_ptr, and std::unique_ptr of std::string, std::string_view, and pqxx::zview. It's not the prettiest code, and some day I hope to generalise this stuff using C++20's Concepts.

Fixes #596.

It'd be nice to support each of `optional`, `shared_ptr`, `unique_ptr`,
and potentially other smart pointer types for each of these string
types.  But doing that without C++20's "concepts" is going to be a
little hairy.
Extends special-case support for `string_view` etc. in `stream_to` to
optional values as well.

This is ugly.  I want to do better.  But it looks like that'll work a
lot better with C++20.
Getting some warnings that look wholly unrelated to my changes, and in
fact seem to be completely internal to the library implementation.
I can't reproduce this compile warning in a `debian:testing` container
on my own machine.  So, just in case the problem is a caching effect,
let's try a newer Debian version.
@jtv jtv merged commit d35ce16 into master Sep 2, 2022
@jtv jtv deleted the stream-optional-string branch September 2, 2022 22:46
@alexolog
Copy link

Please apply a similar fix to #694 694

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.

std::optional<std::string_view>> not working in stream_to.
2 participants