diff --git a/src/rttr/detail/impl/argument_impl.h b/src/rttr/detail/impl/argument_impl.h index bcaab73b..a2729b6d 100644 --- a/src/rttr/detail/impl/argument_impl.h +++ b/src/rttr/detail/impl/argument_impl.h @@ -60,7 +60,7 @@ template argument::argument(const T& data) RTTR_NOEXCEPT : m_data(reinterpret_cast(std::addressof(data))), m_variant(nullptr), - m_type(rttr::type::get()) + m_type(rttr::type::get(data)) { static_assert(!std::is_same::value, "Don't use the argument class for forwarding an instance!"); } @@ -71,7 +71,7 @@ template argument::argument(T& data) RTTR_NOEXCEPT : m_data(reinterpret_cast(std::addressof(data))), m_variant(nullptr), - m_type(rttr::type::get()) + m_type(rttr::type::get(data)) { static_assert(!std::is_same::value, "Don't use the argument class for forwarding an instance!"); }