rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.12k stars 430 forks source link

rttr 0.9.6 compile error #299

Open sonya-soyoung opened 3 years ago

sonya-soyoung commented 3 years ago

Hi guys, I try to develop using the rttr library. Would you let me know the solution?

  1. $make --> error file ==> src/detail/variant_data_policy.h --> error message ==> ‘new’ of ‘initializer_list’ does not extend the lifetime of the underlying array [-Werror=init-list-lifetime] --> error code ==>

    static RTTR_INLINE void clone(const T& value, variant_data& dest) { reinterpret_cast<T*&>(dest) = new T(value); // here,, "new T(value)"

    } template\<typename U> static RTTR_INLINE void create(U&& value, variant_data& dest) { reinterpret_cast<T*&>(dest) = new T(std::forward(value)); // here, "new T(std::forward(value))" }