From 4a9ba2088c487b2bde2768b8cdc00a73e3eb72a8 Mon Sep 17 00:00:00 2001 From: An Tao Date: Wed, 26 Aug 2020 20:53:04 +0800 Subject: [PATCH] Remove the expired std::iterator template (#554) --- orm_lib/inc/drogon/orm/ResultIterator.h | 9 ++------- orm_lib/inc/drogon/orm/RowIterator.h | 8 ++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/orm_lib/inc/drogon/orm/ResultIterator.h b/orm_lib/inc/drogon/orm/ResultIterator.h index 643ceb9d..d4f1eefd 100644 --- a/orm_lib/inc/drogon/orm/ResultIterator.h +++ b/orm_lib/inc/drogon/orm/ResultIterator.h @@ -23,15 +23,10 @@ namespace drogon { namespace orm { -class ConstResultIterator - : public std::iterator, - protected Row +class ConstResultIterator : protected Row { public: + using iterator_category = std::random_access_iterator_tag; using pointer = const Row *; using reference = const Row &; using value_type = const Row; diff --git a/orm_lib/inc/drogon/orm/RowIterator.h b/orm_lib/inc/drogon/orm/RowIterator.h index 5e2feb0e..3015aa07 100644 --- a/orm_lib/inc/drogon/orm/RowIterator.h +++ b/orm_lib/inc/drogon/orm/RowIterator.h @@ -23,12 +23,7 @@ namespace drogon { namespace orm { -class ConstRowIterator : public std::iterator, - protected Field +class ConstRowIterator : protected Field { public: using pointer = const Field *; @@ -36,6 +31,7 @@ class ConstRowIterator : public std::iterator()