rttrorg / rttr

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

std::chrono::duration + >=VS2019 #332

Open harsszegi opened 2 years ago

harsszegi commented 2 years ago

Hello, the following fails on VS 2019

using microsecDouble = std::chrono::duration<double, std::micro>; auto microsecDoubleType = ::rttr::type::get();

with

foo.cpp c:\workspace\rttr\include\rttr/detail/type/type_data.h(331,1): error C2752: 'rttr::detail::template_type_trait': more than one partial specialization matches the template argument list [c:\workspace\test\build\foo.vcxproj] with [ T=non_ref_type ] c:\workspace\rttr\include\rttr/detail/misc/template_type_trait_impl.h(135,1): message : could be 'rttr::detail::template_type_trait<T>' [c:\workspace\test\build\foo.vcxproj] c:\workspace\rttr\include\rttr/detail/misc/template_type_trait_impl.h(136,1): message : or 'rttr::detail::template_type_trait<T>' [c:\workspace\test\build\foo.vcxproj] c:\workspace\rttr\include\rttr/detail/misc/template_type_trait_impl.h(137,1): message : or 'rttr::detail::template_type_trait<T>' [c:\workspace\test\build\foo.vcxproj] c:\workspace\rttr\include\rttr/detail/misc/template_type_trait_impl.h(138,1): message : or 'rttr::detail::template_type_trait<T>' [c:\workspace\test\build\foo.vcxproj] c:\workspace\rttr\include\rttr/detail/type/type_impl.h(304): message : see reference to function template instantiation 'std::unique_ptr<rttr::detail::type_data,std::default_delete> rttr::detail::make_type_data(void)' being compiled [c:\workspace\test\build\foo.vcxproj] with [ T=non_ref_type ] c:\workspace\rttr\include\rttr/detail/type/type_impl.h(371): message : see reference to function template instantiation 'rttr::type rttr::detail::create_or_get_type(void) noexcept' being compiled [c:\workspace\test\build\foo.vcxproj] c:\workspace\rttr\include\rttr/detail/misc/template_type_trait_impl.h(44): message : see reference to function template instantiation 'rttr::type rttr::type::get(void) noexcept' being compiled [c:\workspace\test\build\foo.vcxproj] c:\workspace\rttr\include\rttr/detail/misc/template_type_trait_impl.h(44): message : while compiling class template member function 'std::vector<rttr::type,std::allocator> rttr::detail::template_type_trait::get_template_arguments(void)' [c:\workspace\test\build\foo.vcxproj] with [ T=non_ref_type ] c:\workspace\rttr\include\rttr/detail/type/type_data.h(301): message : see reference to function template instantiation 'std::vector<rttr::type,std::allocator> rttr::detail::template_type_trait::get_template_arguments(void)' being compiled [c:\workspace\test\build\foo.vcxproj] with [ T=non_ref_type ] c:\workspace\rttr\include\rttr/detail/type/type_data.h(331): message : see reference to class template instantiation 'rttr::detail::template_type_trait' being compiled [c:\workspace\test\build\foo.vcxproj] with [ T=non_ref_type ] c:\workspace\rttr\include\rttr/detail/type/type_impl.h(304): message : see reference to function template instantiation 'std::unique_ptr<rttr::detail::type_data,std::default_delete> rttr::detail::make_type_data(void)' being compiled [c:\workspace\test\build\foo.vcxproj] with [ T=non_ref_type ] c:\workspace\rttr\include\rttr/detail/type/type_impl.h(371): message : see reference to function template instantiation 'rttr::type rttr::detail::create_or_get_type(void) noexcept' being compiled [c:\workspace\test\build\foo.vcxproj] c:\workspace\test\foo.cpp(7): message : see reference to function template instantiation 'rttr::type rttr::type::get(void) noexcept' being compiled [c:\workspace\test\build\foo.vcxproj]

When compiling with VS 2017, or with Linux, everything is fine. Any thoughts? Thanks,

ivti commented 2 years ago

just if this is like a showstopper:

you can use VS2017 compiled libs also with VS2019. This is since VS2015 the case.

Anyway the error should be removed.