We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I try to concatenate list entries using std::stringstream And was lazy enough to not try writing custom iterator
To Reproduce
std::stringstream s; redis.lrange(key, 0, -1, std::ostream_iterator<std::string>(s, "\0"));
Expected behavior list entries '\0'-separated in stream
Environment:
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
The problem is that ostream_iterator<string>::value_type is void not string, and redis-plus-plus cannot correctly parse reply to it.
ostream_iterator<string>::value_type
void
string
A workaround is that you can parse the reply to vector<string>, and move these strings to stringstream.
vector<string>
stringstream
vector<string> vec; redis.lrange("l", 0, -1, std::back_inserter(vec)); std::stringstream s; std::copy(std::make_move_iterator(vec.begin()), std::make_move_iterator(vec.end()), std::ostream_iterator<std::string>(s, "\0"));
I'll try to figure out a way to fix the problem.
Regards
Sorry, something went wrong.
No branches or pull requests
Describe the bug
I try to concatenate list entries using std::stringstream
And was lazy enough to not try writing custom iterator
To Reproduce
Expected behavior
list entries '\0'-separated in stream
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: