fixed issue which prevented to use setProperty with reference types

Tested:
  aligned example/register-property to use reference types, executed and
  verified that example is working after change

Change-Id: I9999bae5f1cc2bb520f74527bd5b7eae8fa1af35
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/example/register-property.cpp b/example/register-property.cpp
index 1f6a730..6fd4c89 100644
--- a/example/register-property.cpp
+++ b/example/register-property.cpp
@@ -48,11 +48,11 @@
     }
 
     template <class OnError, class OnSuccess>
-    void async_set(T&& value, OnError&& onError, OnSuccess&& onSuccess)
+    void async_set(const T& value, OnError&& onError, OnSuccess&& onSuccess)
     {
-        sdbusplus::asio::setProperty(
-            bus_, service_, path_, interface_, name_, std::forward<T>(value),
-            std::forward<OnError>(onError), std::forward<OnSuccess>(onSuccess));
+        sdbusplus::asio::setProperty(bus_, service_, path_, interface_, name_,
+                                     value, std::forward<OnError>(onError),
+                                     std::forward<OnSuccess>(onSuccess));
     }
 
   private:
diff --git a/include/sdbusplus/asio/property.hpp b/include/sdbusplus/asio/property.hpp
index 94a5820..da34325 100644
--- a/include/sdbusplus/asio/property.hpp
+++ b/include/sdbusplus/asio/property.hpp
@@ -80,7 +80,8 @@
             onSuccess();
         },
         service, path, "org.freedesktop.DBus.Properties", "Set", interface,
-        propertyName, std::variant<T>(std::forward<T>(propertyValue)));
+        propertyName,
+        std::variant<std::decay_t<T>>(std::forward<T>(propertyValue)));
 }
 
 } // namespace sdbusplus::asio