-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ 20 Windows Build Problem #49
Comments
@TaeZStkyoht seems really strange that boolinq/include/boolinq/boolinq.h Lines 600 to 607 in a362fe9
What compiler and version do you use? |
I'm using Visual Studio 2019 v16.11.1 on Windows. By the way it's not only toStdVector but also almost all other functions. |
result_of is deprecated in c++ 20 and needs to be replaced with invoke_result. |
@RoqueDeicide @TaeZStkyoht @ZumZoom any ideas how to write universal code using |
This code, when put at the top of the file, should allow the rest of the code to stay the same: #if (defined(_MSC_VER) && _MSVC_LANG >= 202002L) || __cplusplus >= 202002L
namespace std
{
template<typename _Callable, typename ..._Args>
using result_of = std::invoke_result<_Callable, _Args...>;
}
#endif |
@k06a Are you planning apply these changes, making a new release and updating it on vcpkg? |
@TaeZStkyoht applied changes to |
@k06a Ok, thanks a lot. |
It seems the version on vcpkg and conan is still 3.0.2. Any plan to update? Thx. |
@Mrhyuan requested cvpkg upgrade here: microsoft/vcpkg#22173 |
@Mrhyuan done via microsoft/vcpkg#22177 |
So fast thank you so much |
@k06a Ok "toStdVector" works now but some of them still doesn't work (especially "select"). Did you try your examples on your readme page? They don't work. Now I'm using Visual Studio 2019 16.11.8, _MSC_VER 1929, _MSVC_LANG 202002L. Your defined macro (The result_of was deprecated since C++20, so redefine it using invoke_result) is active because these versions satisfy it. Your example:
Errors:
It still works with C++17 on Windows and any modern C++ version on Linux. @RoqueDeicide Did you also try your work? |
@TaeZStkyoht try to specify lambda return type as |
Sad to hear that. This means our template to get return type is not working as expected. |
#61 Should fix this for good. |
@RoqueDeicide nope. It will not be copiled gcc trunk and clang trunk. @k06a use my suggestion. This is the only compatible solution for now. If you decide not to support before C++17 in the future, just remove this definition and use invoke_result instead. |
And lol @RoqueDeicide You just copied my code and created own pull request? |
@TaeZStkyoht, My code is based on "possible implementation" section of I'm not sure about compatibility with compilers that hadn't removed |
@TaeZStkyoht @RoqueDeicide thanks for the contributions, I will merge both and resolve conflicts 😁👌👍 |
Merged both, introduced subnamespace |
I am using your library. It could be built with C++ 17. But now I've changed my projects to be built with C++ 20 and it gives errors. Simple example error is like that:
The text was updated successfully, but these errors were encountered: