diff --git a/lib/cpp/src/thrift/Thrift.h b/lib/cpp/src/thrift/Thrift.h index 338694b7f3f..3a26ab67b45 100644 --- a/lib/cpp/src/thrift/Thrift.h +++ b/lib/cpp/src/thrift/Thrift.h @@ -50,9 +50,11 @@ namespace apache { namespace thrift { -class TEnumIterator - : public std::iterator > { +class TEnumIterator { public: + using iterator_category = std::forward_iterator_tag; + using value_type = std::pair; + TEnumIterator(int n, int* enums, const char** names) : ii_(0), n_(n), enums_(enums), names_(names) {} diff --git a/lib/cpp/src/thrift/transport/TSocketUtils.h b/lib/cpp/src/thrift/transport/TSocketUtils.h index c9e0e57b882..b0916b3dde7 100644 --- a/lib/cpp/src/thrift/transport/TSocketUtils.h +++ b/lib/cpp/src/thrift/transport/TSocketUtils.h @@ -62,7 +62,10 @@ struct AddressResolutionHelper { public: using PtrOwnedList = std::unique_ptr; - struct Iter : std::iterator { + struct Iter { + using iterator_category = std::forward_iterator_tag; + using value_type = const addrinfo*; + value_type ptr = nullptr; Iter() = default;