[NFC] Provide exception overloads without context#3375
Closed
falbrechtskirchinger wants to merge 2 commits intonlohmann:developfrom
Closed
[NFC] Provide exception overloads without context#3375falbrechtskirchinger wants to merge 2 commits intonlohmann:developfrom
falbrechtskirchinger wants to merge 2 commits intonlohmann:developfrom
Conversation
Provide overloads for static exception create() member functions without const BasicJsonType &context parameter.
Contributor
|
I'm not wild about the duplication, and this makes it easier to forget to see if there is an appropriate context parameter available. What about changing it from a reference to a pointer so that the callers that don't have one can just pass |
Contributor
Author
|
Fair enough. I don't like the duplication either. This is a low-priority item and I'll get to it eventually. |
Contributor
Author
|
This has been folded into #3415 with changes requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the static
create()member functions of exceptions require aconst BasicJsonType &contextparameter. This PR adds overloads without acontextparameter and replaces uses ofJSON_THROW(exception_type::create(..., BasicJsonType()))and similar with thecontext-less version.This removes one obstacle to freeing
json_pointerfrom its class template parameter in the future.