-
-
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
Add a SFINAE friendly iterator_traits and use that instead. #1342
Add a SFINAE friendly iterator_traits and use that instead. #1342
Conversation
@davedissian Could you please have a look at the requested changes? |
@nlohmann Sorry, yes. Been meaning to get round to it :) |
I think this is ready to merge. @theodelrieu Do you agree? |
typedef T value_type; | ||
typedef ptrdiff_t difference_type; | ||
typedef T* pointer; | ||
typedef T& reference; |
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.
I would prefer using
, but that's a minor thing
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.
I agree. @davedissian could you please make this last change. Then it should be good to go. Thanks!
I added a minor comment, otherwise it looks good to me |
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! |
Fixes #1341 by implementing our own
iterator_traits
and using that instead to detect whether a type is an iterator.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.