nana::any bug fix - argument not forwarded
A constructor and an overload of the assignment operator each have a forwarding reference as a parameter, but they don't actually forward the argument.
This commit is contained in:
parent
b7a0874428
commit
e626f816b3
@ -74,7 +74,7 @@ namespace nana
|
||||
any(Value && value,
|
||||
typename std::enable_if<!std::is_same<any&, Value>::value>::type * = nullptr,
|
||||
typename std::enable_if<!std::is_const<Value>::value>::type* = nullptr)
|
||||
: content_(new holder<typename std::decay<Value>::type>(static_cast<Value&&>(value)))
|
||||
: content_(new holder<typename std::decay<Value>::type>(std::forward<Value>(value)))
|
||||
{
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ namespace nana
|
||||
template<class Value>
|
||||
any& operator=(Value&& other)
|
||||
{
|
||||
any(other).swap(*this);
|
||||
any(std::forward<Value>(other)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user