Skip to content
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

Remove static asserts #1228

Merged
merged 12 commits into from
Sep 9, 2018
Merged

Conversation

theodelrieu
Copy link
Contributor

@theodelrieu theodelrieu commented Sep 6, 2018

This PR addresses issues #960.

There is some refactoring in detail/meta, the checks we perform were too brittle (I fixed some issues in the mean time).

At some point I'd like to iron out the quirks in meta, (e.g. is_compatible_* traits, etc...), but this is not the goal of this PR.

I will sum up the pros/cons of this PR that can be found in detail in #960:

Pros:

Cons:

  • No more static_assert, instead the compiler will yell that no constructor could be used.

Pull request checklist

Read the Contribution Guidelines for detailed information.

  • Changes are described in the pull request, or an existing issue is referenced.
  • The test suite compiles and runs without error.
  • Code coverage is 100%. Test cases can be added by editing the test suite.
  • The source code is amalgamated; that is, after making changes to the sources in the include/nlohmann directory, run make amalgamate to create the single-header file single_include/nlohmann/json.hpp. The whole process is described here.

@theodelrieu theodelrieu force-pushed the remove_static_asserts branch from 28d2376 to 3f1abad Compare September 7, 2018 10:57
@theodelrieu theodelrieu force-pushed the remove_static_asserts branch from 3f1abad to aea648b Compare September 7, 2018 12:11
@coveralls
Copy link

coveralls commented Sep 7, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling aea648b on theodelrieu:remove_static_asserts into eb30ff0 on nlohmann:develop.

@nlohmann
Copy link
Owner

nlohmann commented Sep 8, 2018

To me, the PR is SFIENA magic... :-S

@gregmarr Do you think the PR is OK to merge?

(I do trust @theodelrieu, but I really fail to understand the individual changes...)

@gregmarr
Copy link
Contributor

gregmarr commented Sep 9, 2018

Those things that I can follow look good. I guess as long as the test suite is still passing, we should be good.

@nlohmann nlohmann self-assigned this Sep 9, 2018
@nlohmann nlohmann added this to the Release 3.2.1 milestone Sep 9, 2018
@nlohmann nlohmann merged commit d3428b3 into nlohmann:develop Sep 9, 2018
@nlohmann
Copy link
Owner

nlohmann commented Sep 9, 2018

Thanks a lot!

nlohmann added a commit that referenced this pull request Sep 9, 2018
@theodelrieu theodelrieu deleted the remove_static_asserts branch September 9, 2018 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants