Undo libosrm API break by adding old interface as method overload#5861
Merged
danpat merged 2 commits intoProject-OSRM:masterfrom Jan 27, 2021
Merged
Undo libosrm API break by adding old interface as method overload#5861danpat merged 2 commits intoProject-OSRM:masterfrom
danpat merged 2 commits intoProject-OSRM:masterfrom
Conversation
6576366 to
41298e0
Compare
Removes the breaking libosrm API change by adding the old interface to the new. This does not introduce any new breaks. The downside of this is that it allows for multiple ways to return JSON responses.
41298e0 to
16ed1c4
Compare
4 tasks
akashihi
reviewed
Oct 20, 2020
Contributor
akashihi
left a comment
There was a problem hiding this comment.
Just thinking loudly - can we use some template magic to avoid methods duplication?
Member
Author
I'm not a templates expert, but with a bit of meta-programming it looks like we can do something like: template <class T,
typename = std::enable_if_t<is_any<T, json::Object, engine::api::ResultT>::value>>
Status Route(const engine::api::RouteParameters ¶ms, T &result) const;Is there a nicer way to do it? This feels a bit more difficult to understand than the overloaded methods, given |
Contributor
|
You meta-programming kung fu is better than mine :) Let's wait for a second opinion. |
Closed
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.
Issue
Alternative to #5860
Removes the breaking libosrm API change by adding the old interface to the new. This does not introduce any new breaks.
The downside of this is that it allows for multiple ways to return JSON responses.
Tasklist
Requirements / Relations
Closes #5741
Closes #5548