Merge pull request #4696 from clementperon/fix_compilation_cpp17
Fix compilation with iterator with C++ 17
This commit is contained in:
@@ -175,8 +175,19 @@ namespace internal {
|
||||
template <typename E>
|
||||
class RepeatedEnumView {
|
||||
public:
|
||||
class Iterator : public std::iterator<std::input_iterator_tag, E> {
|
||||
class Iterator
|
||||
#if __cplusplus < 201703L
|
||||
: public std::iterator<std::input_iterator_tag, E>
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
using difference_type = ptrdiff_t;
|
||||
using value_type = E;
|
||||
#if __cplusplus >= 201703L
|
||||
using iterator_category = std::input_iterator_tag;
|
||||
using pointer = E*;
|
||||
using reference = E&;
|
||||
#endif
|
||||
explicit Iterator(RepeatedField<int>::const_iterator ptr) : ptr_(ptr) {}
|
||||
bool operator==(const Iterator& it) const { return ptr_ == it.ptr_; }
|
||||
bool operator!=(const Iterator& it) const { return ptr_ != it.ptr_; }
|
||||
|
||||
Reference in New Issue
Block a user