From 9c1ee78f41c8c291565f32f41d594aa2a983e175 Mon Sep 17 00:00:00 2001 From: Kyoril Date: Sat, 14 Mar 2020 13:55:46 +0100 Subject: [PATCH 1/2] Fixed C++17 deprecation warnings --- luabind/detail/crtp_iterator.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/luabind/detail/crtp_iterator.hpp b/luabind/detail/crtp_iterator.hpp index 7973ba5f..b655cf40 100644 --- a/luabind/detail/crtp_iterator.hpp +++ b/luabind/detail/crtp_iterator.hpp @@ -1,4 +1,4 @@ -#ifndef LUABIND_CRTP_ITERATOR_HPP_INCLUDED +#ifndef LUABIND_CRTP_ITERATOR_HPP_INCLUDED #define LUABIND_CRTP_ITERATOR_HPP_INCLUDED #include @@ -7,13 +7,16 @@ namespace luabind { namespace detail { template< typename CRTP, typename Category, typename ValueType, typename ReferenceType = ValueType&, typename DifferenceType = ptrdiff_t > - class crtp_iterator : - public std::iterator + class crtp_iterator { public: - using base_type = std::iterator; - + using iterator_category = Category; + using value_type = ValueType; + using difference_type = DifferenceType; + using pointer = ValueType * ; + using reference = ReferenceType; + public: CRTP& operator++() { upcast().increment(); @@ -37,12 +40,12 @@ namespace luabind { return !upcast().equal(rhs); } - typename base_type::reference operator*() + typename reference operator*() { return upcast().dereference(); } - typename base_type::reference operator->() + typename reference operator->() { return upcast().dereference(); } From 6303e2a090ef19a99a112c4b346232c93034f97f Mon Sep 17 00:00:00 2001 From: Kyoril Date: Sat, 14 Mar 2020 14:24:21 +0100 Subject: [PATCH 2/2] Fixed gcc compile error --- luabind/detail/crtp_iterator.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luabind/detail/crtp_iterator.hpp b/luabind/detail/crtp_iterator.hpp index b655cf40..bcf26893 100644 --- a/luabind/detail/crtp_iterator.hpp +++ b/luabind/detail/crtp_iterator.hpp @@ -40,12 +40,12 @@ namespace luabind { return !upcast().equal(rhs); } - typename reference operator*() + reference operator*() { return upcast().dereference(); } - typename reference operator->() + reference operator->() { return upcast().dereference(); }