-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
meta: fix is_compatible/constructible traits #3020
meta: fix is_compatible/constructible traits #3020
Conversation
I ran |
28c2cea
to
7fb7fc8
Compare
Would it be worth doing that in a separate commit within the PR or even a separate PR? |
I'll fix it. |
be29787
to
d58c4ac
Compare
The previous version relied on the existence of an 'iterator' type. As mentioned in comments, this is not the proper way to do it and causes issues with certain types (e.g. views from range-v3). Add a 'is_range' trait that properly detects the return type of 'begin'/'end', and use it in instead.
d58c4ac
to
7b2d591
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks a lot! |
Antiquated type traits performed an incorrect and insufficient check. std::filesystem::path used to work by "chance" thanks to brittle constraints, but the clean-up performed in nlohmann#3020 broke these. Fixes nlohmann#3070
These type traits performed an incorrect and insufficient check. Converting to a std::filesystem::path used to work by accident thanks to these brittle constraints, but the clean-up performed in nlohmann#3020 broke them.
These type traits performed an incorrect and insufficient check. Converting to a std::filesystem::path used to work by accident thanks to these brittle constraints, but the clean-up performed in nlohmann#3020 broke them.
These type traits performed an incorrect and insufficient check. Converting to a std::filesystem::path used to work by accident thanks to these brittle constraints, but the clean-up performed in nlohmann#3020 broke them.
* meta: rework is_compatible/is_constructible_string_type These type traits performed an incorrect and insufficient check. Converting to a std::filesystem::path used to work by accident thanks to these brittle constraints, but the clean-up performed in #3020 broke them. * support std::filesystem::path Fixes #3070
(my previous PR was empty and got auto-closed, duh)
The previous version relied on the existence of an iterator member type.
As mentioned in comments, this is not the proper way to do it and causes issues with certain types (e.g. views from range-v3 which do not have such an alias).
Add a is_range trait that properly detects the return type of begin/end, and use it instead.
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.