rttrorg / rttr

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

Support for vs2022 (c++20) #360

Open weypro opened 1 year ago

weypro commented 1 year ago
In file included from ...
In file included from ...
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\iostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\istream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ios:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocnum:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\cmath:26:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\__msvc_iter_core.hpp:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\utility:11:
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\type_traits:803:50: error: incomplete type 'rttr::argument' used in type trait expression
struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> {
                                                 ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\type_traits:59:53: note: in instantiation of template class 'std::is_trivially_destructible<rttr::argument>' requested here
struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest...>::type {
                                                    ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\type_traits:64:44: note: in instantiation of template class 'std::conjunction<std::is_trivially_destructible<rttr::argument>, std::disjunction<std::_Is_default_allocator<std::allocator<rttr::argument>>, std::_Has_no_alloc_destroy<std::allocator<rttr::argument>, rttr::argument *>>>' requested here
_INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value;
                                           ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xmemory:946:20: note: in instantiation of variable template specialization 'std::conjunction_v<std::is_trivially_destructible<rttr::argument>, std::disjunction<std::_Is_default_allocator<std::allocator<rttr::argument>>, std::_Has_no_alloc_destroy<std::allocator<rttr::argument>, rttr::argument *>>>' requested here
    if constexpr (!conjunction_v<is_trivially_destructible<_Ty>, _Uses_default_destroy<_Alloc, _Ty*>>) {
                   ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:2108:13: note: in instantiation of function template specialization 'std::_Destroy_range<std::allocator<rttr::argument>>' requested here
            _Destroy_range(_Myfirst, _Mylast, _Al);
            ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:830:9: note: in instantiation of member function 'std::vector<rttr::argument>::_Tidy' requested here
        _Tidy();
        ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/type.h:682:53: note: in instantiation of member function 'std::vector<rttr::argument>::~vector' requested here
        variant create(std::vector<argument> args = std::vector<argument>()) const;
                                                    ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/property.h:45:7: note: forward declaration of 'rttr::argument'
class argument;
      ^
In file included from ...
In file included from ...
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\iostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\istream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ios:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocnum:16:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\streambuf:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xiosbase:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\system_error:14:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdexcept:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xstring:14:
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xmemory:946:20: error: constexpr if condition is not a constant expression
    if constexpr (!conjunction_v<is_trivially_destructible<_Ty>, _Uses_default_destroy<_Alloc, _Ty*>>) {
                  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:2108:13: note: in instantiation of function template specialization 'std::_Destroy_range<std::allocator<rttr::argument>>' requested here
            _Destroy_range(_Myfirst, _Mylast, _Al);
            ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:830:9: note: in instantiation of member function 'std::vector<rttr::argument>::_Tidy' requested here
        _Tidy();
        ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/type.h:682:53: note: in instantiation of member function 'std::vector<rttr::argument>::~vector' requested here
        variant create(std::vector<argument> args = std::vector<argument>()) const;
                                                    ^
In file included from ...
In file included from ...
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\iostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\istream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ios:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocnum:16:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\streambuf:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xiosbase:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\system_error:14:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdexcept:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xstring:14:
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xmemory:947:33: error: arithmetic on a pointer to an incomplete type 'std::_Default_allocator_traits<std::allocator<rttr::argument>>::value_type' (aka 'rttr::argument')
        for (; _First != _Last; ++_First) {
                                ^ ~~~~~~
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/property.h:45:7: note: forward declaration of 'rttr::argument'
class argument;
      ^
In file included from ...
In file included from ...
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\iostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\istream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ios:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocnum:16:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\streambuf:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xiosbase:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\system_error:14:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdexcept:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xstring:14:
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xmemory:69:56: error: invalid application of 'alignof' to an incomplete type 'rttr::argument'
_INLINE_VAR constexpr size_t _New_alignof = (_STD max)(alignof(_Ty), __STDCPP_DEFAULT_NEW_ALIGNMENT__);
                                                       ^~~~~~~~~~~~
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xmemory:830:21: note: in instantiation of variable template specialization 'std::_New_alignof<rttr::argument>' requested here
        _Deallocate<_New_alignof<_Ty>>(_Ptr, sizeof(_Ty) * _Count);
                    ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:2110:17: note: in instantiation of member function 'std::allocator<rttr::argument>::deallocate' requested here
            _Al.deallocate(_Myfirst, static_cast<size_type>(_Myend - _Myfirst));
                ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:830:9: note: in instantiation of member function 'std::vector<rttr::argument>::_Tidy' requested here
        _Tidy();
        ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/type.h:682:53: note: in instantiation of member function 'std::vector<rttr::argument>::~vector' requested here
        variant create(std::vector<argument> args = std::vector<argument>()) const;
                                                    ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/property.h:45:7: note: forward declaration of 'rttr::argument'
class argument;
      ^
In file included from ...
In file included from ...
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\iostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\istream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ostream:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ios:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocnum:16:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\streambuf:11:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xiosbase:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\system_error:14:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\stdexcept:12:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xstring:14:
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xmemory:830:46: error: invalid application of 'sizeof' to an incomplete type 'rttr::argument'
        _Deallocate<_New_alignof<_Ty>>(_Ptr, sizeof(_Ty) * _Count);
                                             ^~~~~~~~~~~
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:2110:17: note: in instantiation of member function 'std::allocator<rttr::argument>::deallocate' requested here
            _Al.deallocate(_Myfirst, static_cast<size_type>(_Myend - _Myfirst));
                ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:830:9: note: in instantiation of member function 'std::vector<rttr::argument>::_Tidy' requested here
        _Tidy();
        ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/type.h:682:53: note: in instantiation of member function 'std::vector<rttr::argument>::~vector' requested here
        variant create(std::vector<argument> args = std::vector<argument>()) const;
                                                    ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/property.h:45:7: note: forward declaration of 'rttr::argument'
class argument;
      ^
In file included from ...
In file included from ...
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\filesystem:16:
In file included from G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\chrono:32:
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:2110:68: error: arithmetic on a pointer to an incomplete type 'std::_Default_allocator_traits<std::allocator<rttr::argument>>::value_type' (aka 'rttr::argument')
            _Al.deallocate(_Myfirst, static_cast<size_type>(_Myend - _Myfirst));
                                                            ~~~~~~ ^
G:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector:830:9: note: in instantiation of member function 'std::vector<rttr::argument>::_Tidy' requested here
        _Tidy();
        ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/type.h:682:53: note: in instantiation of member function 'std::vector<rttr::argument>::~vector' requested here
        variant create(std::vector<argument> args = std::vector<argument>()) const;
                                                    ^
I:/Program Files/vcpkg/installed/x64-windows/include\rttr/property.h:45:7: note: forward declaration of 'rttr::argument'
class argument;
      ^

Environment: Clang15+vs2022

SUPPH commented 9 months ago

I encountered the same problem!Is there a way to solve?anyone help

jakerieger commented 2 months ago

I encountered the same problem!Is there a way to solve?anyone help

Unfortunately, the solution is to just use VS2017 (the last supported version). You can still download it here: https://download.visualstudio.microsoft.com/download/pr/95bca199-fa8c-4915-ba45-28502dbad1a4/0a5ead7d5b766b05be60cef913cc43ed1065a199b55e09e95806b213a37498fa/vs_Community.exe

StinkyTooFool commented 2 months ago

c++std=17