meta: fix is_compatible/constructible traits by theodelrieu · Pull Request #3020 · nlohmann/json

gregmarr

nlohmann

@theodelrieu

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.

nlohmann

theodelrieu added a commit to theodelrieu/json that referenced this pull request

Oct 11, 2021
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

theodelrieu added a commit to theodelrieu/json that referenced this pull request

Oct 13, 2021
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.

theodelrieu added a commit to theodelrieu/json that referenced this pull request

Oct 13, 2021
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.

theodelrieu added a commit to theodelrieu/json that referenced this pull request

Oct 14, 2021
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.

nlohmann pushed a commit that referenced this pull request

Oct 14, 2021
* 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