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

Missing implementation for std::vector<std::optional<std::string>> #233

Closed
gelldur opened this issue Feb 5, 2025 · 1 comment · Fixed by #234
Closed

Missing implementation for std::vector<std::optional<std::string>> #233

gelldur opened this issue Feb 5, 2025 · 1 comment · Fixed by #234

Comments

@gelldur
Copy link

gelldur commented Feb 5, 2025

When want to receive multiple keys and keys may be not present.
If I use vector<string> then it will fail if at least 1 key is missing.

	std::map<std::string, std::string> result;
	boost::redis::request req;

	req.push_range("MGET", keys.begin(), keys.end());
	boost::redis::response<std::vector<std::optional<std::string>>> res;

	exec(req, res);
error: no matching function for call to 'boost_redis_from_bulk'
include/boost/redis/adapter/detail/adapters.hpp:387:7: note: in instantiation of function template specialization 'boost::redis::adapter::detail::vector_impl<std::vector<std::optional<std::basic_string<char>>>>::operator()<std::basic_string_view<char>>' requested here

When using: boost::redis::response<std::optional<std::vector<std::string>>> res;
It will mismatch number of expected responses.

@mzimbres
Copy link
Collaborator

mzimbres commented Feb 8, 2025

Thanks for reporting, I will have a look at it soon.

@mzimbres mzimbres linked a pull request Feb 19, 2025 that will close this issue
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 a pull request may close this issue.

2 participants