gul-cpp / gul14

General Utility Library for C++14
https://gul14.info/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Provide backports of std::invoke, invoke_result, is_invokable and friends #68

Closed alt-graph closed 8 months ago

alt-graph commented 8 months ago

This PR extracts the definitions of the C++17 backports of

from M. Park's variant header and makes them available in the public traits.h header in namespace gul14. The definitions are useful for GUL14 users in general, but we can also use them inside the library. This PR uses them to replace an ad-hoc implementation in our expected header, and they will be needed for the ThreadPool PR.

Finii commented 8 months ago

For some reason the _v versions are missing here?

image

alt-graph commented 8 months ago

For some reason the _v versions are missing here?

If I am not mistaken, the _v versions are variable templates, and that language feature is missing from C++14.

alt-graph commented 8 months ago

Rebased on main.

Finii commented 8 months ago

If I am not mistaken, the _v versions are variable templates, and that language feature is missing from C++14.

Ah, its inline variables that is missing in C++14 that we would need, but yes. Variable templates are part of C++14. Without inline it would fail if we use is_invocable_v two times with identical parameters.

Adding a commit with some very very simple tests (that I used to find a is_invocable_v formulation), maybe they are kind of how to use. Maybe just drop that commit.

Finii commented 8 months ago

@soerengrunewald

I believe the license in the RPM spec is wrong; but I could not find out how multiple licenses are specified there. Also the version is wrong (2.7 in RPM but 2.10 in reality) etc pp.

I would call RPMs unsupported. Maybe I should raise an error Issue.

alt-graph commented 8 months ago

This looks good. Feel free to drop the meaningless tests, but then maybe they just raise the test coverage and help sanitizer runs.

Oops, I think I just force-pushed over them. Sorry! I'll merge as-is, but maybe you can push the commit as a new PR?

Finii commented 8 months ago

Oops, I think I just force-pushed over them

git push --force-with-lease origin ... protects you from over-force-pushing.

alt-graph commented 8 months ago

git push --force-with-lease origin ... protects you from over-force-pushing.

Thanks, I did not know that. :+1:

Finii commented 8 months ago

git push --force-with-lease origin ... protects you from over-force-pushing.

Thanks, I did not know that. 👍

Just learned that yesterday :-D

So You Think You Know Git - FOSDEM 2024 (at 17:42)