From e626f816b38c95cf61af189e4514ef102841549e Mon Sep 17 00:00:00 2001 From: ErrorFlynn Date: Mon, 16 Sep 2019 06:07:04 -0400 Subject: [PATCH] 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. --- include/nana/any.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nana/any.hpp b/include/nana/any.hpp index ed711146..9a90ca2f 100644 --- a/include/nana/any.hpp +++ b/include/nana/any.hpp @@ -74,7 +74,7 @@ namespace nana any(Value && value, typename std::enable_if::value>::type * = nullptr, typename std::enable_if::value>::type* = nullptr) - : content_(new holder::type>(static_cast(value))) + : content_(new holder::type>(std::forward(value))) { } @@ -87,7 +87,7 @@ namespace nana template any& operator=(Value&& other) { - any(other).swap(*this); + any(std::forward(other)).swap(*this); return *this; }