sewenew / redis-plus-plus

Redis client written in C++
Apache License 2.0
1.6k stars 347 forks source link

[BUG] `parse_variant()` may inadvertently move lvalues #589

Closed TedLyngmo closed 2 weeks ago

TedLyngmo commented 3 weeks ago

Describe the bug reply.h:312:36: forwarding reference passed to std::move()

To Reproduce Make sure a non-const lvalue is processed. The

template< class T >
constexpr variant( T&& t )

constructor of the Variant will be used which will forward that to the constructor of the matching type.

Expected behavior Expecting non-temporaries to be copied instead of moved. That is, use std::forward instead of std::move