rttr icon indicating copy to clipboard operation
rttr copied to clipboard

rttr 0.9.6 compile error

Open sonya-soyoung opened this issue 4 years ago • 0 comments

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

  • OS : cygwin64
  • Order :
  1. $cmake . --> I had used the changed command ( "cmake ." ) because the error was invoked error if I use the command ( "cmake -DCMAKE_BUILD_TYPE=Release <Path to RTTR src code>" ) by recommendation of the site (https://www.rttr.org/doc/master/building_install_page.html).

  2. $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<U>(value)); // here, "new T(std::forward<U>(value))"
}

sonya-soyoung avatar Dec 23 '20 04:12 sonya-soyoung