clipp
clipp copied to clipboard
Fix build for C++20, Fix #53
As reported in #53:
C++20 removed the deprecated std::result_of in favor of std::invoke_result. Switch between usage of those depending on the cpp_lib_is_invocable feature test macro.
See:
- https://en.cppreference.com/w/cpp/types/result_of
- https://en.cppreference.com/w/cpp/feature_test#Library_features
An alternative solution would be to use decltype instead of either of those two templates, if you prefer that I'd be happy to update my PR.
Hi, I need this P.R. merged to use clipp
in a C++20 project. What is blocking merging it?
please consider merging this pr
If you use vcpkg then this patch is being applied care of https://github.com/microsoft/vcpkg/issues/27167
If you use vcpkg then this patch is being applied care of microsoft/vcpkg#27167
the patch still doesn't fix the compilation. i still get this error with c++20
Severity Code Description Project File Line Suppression State
Warning C26495 Variable 'clipp::group::child_t<clipp::parameter,clipp::group>::data::group' is uninitialized. Always initialize a member variable (type.6). C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 2772
Error (active) E0312 no suitable user-defined conversion from "const clipp::group::child" to "const clipp::group::child" exists C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 2968
Error (active) E0120 return value type does not match the function type C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 2973
Error (active) E0040 expected an identifier C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6324
Error (active) E0040 expected an identifier C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6734
Error (active) E0070 incomplete type is not allowed C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\type_traits 762
Error (active) E0852 expression must be a pointer to a complete object type C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector 1752
Error (active) E0393 pointer to incomplete class type "_MAC_adapter_raw_info" is not allowed C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xmemory 311
Error (active) E0070 incomplete type is not allowed C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xmemory 797
Error (active) E0852 expression must be a pointer to a complete object type C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\xmemory 904
Warning C26495 Variable 'clipp::group::child_t<clipp::parameter,clipp::group>::data::param' is uninitialized. Always initialize a member variable (type.6). C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 2772
Warning C26495 Variable 'clipp::group::depth_first_traverser::memento::level_' is uninitialized. Always initialize a member variable (type.6). C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 2831
Warning C4003 not enough arguments for function-like macro invocation 'max' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 332
Warning C4003 not enough arguments for function-like macro invocation 'max' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 333
Error C2589 '(': illegal token on right side of '::' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 332
Error C2589 '(': illegal token on right side of '::' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 5909
Error C2589 '(': illegal token on right side of '::' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6324
Error C2062 type 'unknown-type' unexpected C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6324
Error C2059 syntax error: ')' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6324
Error C2589 '(': illegal token on right side of '::' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6734
Error C2062 type 'unknown-type' unexpected C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6734
Error C2059 syntax error: ')' C:\dev\vcpkg\installed\x86-windows-static\include\clipp.h 6734
@danyhm That's a different error that you have.
Maybe you can try https://github.com/GerHobbelt/clipp as that seems to be more up to date.