From 2f5a6fbcf12038aea002a8465d5424c27f823a22 Mon Sep 17 00:00:00 2001 From: Daniel Frey Date: Sun, 15 Oct 2017 10:34:04 +0200 Subject: [PATCH] Adapt to C++17, fixes #34 --- include/boost/operators.hpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/include/boost/operators.hpp b/include/boost/operators.hpp index 3fc08d5..11bca21 100644 --- a/include/boost/operators.hpp +++ b/include/boost/operators.hpp @@ -1,7 +1,7 @@ // Boost operators.hpp header file ----------------------------------------// // (C) Copyright David Abrahams, Jeremy Siek, Daryle Walker 1999-2001. -// (C) Copyright Daniel Frey 2002-2016. +// (C) Copyright Daniel Frey 2002-2017. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -9,6 +9,8 @@ // See http://www.boost.org/libs/utility/operators.htm for documentation. // Revision History +// 15 Oct 17 Adapted to C++17, replace std::iterator<> with manual +// implementation. // 22 Feb 16 Added ADL protection, preserve old work-arounds in // operators_v1.hpp and clean up this file. (Daniel Frey) // 16 Dec 10 Limit warning suppression for 4284 to older versions of VC++ @@ -824,6 +826,21 @@ template struct operators // Iterator helper classes (contributed by Jeremy Siek) -------------------// // (Input and output iterator helpers contributed by Daryle Walker) -------// // (Changed to use combined operator classes by Daryle Walker) ------------// +// (Adapted to C++17 by Daniel Frey) --------------------------------------// +template +struct iterator_helper +{ + typedef Category iterator_category; + typedef T value_type; + typedef Distance difference_type; + typedef Pointer pointer; + typedef Reference reference; +}; + template struct input_iterator_helper : input_iteratable > {}; template struct output_iterator_helper : output_iteratable > { T& operator*() { return static_cast(*this); } @@ -851,7 +868,7 @@ template struct forward_iterator_helper : forward_iteratable > {}; template struct bidirectional_iterator_helper : bidirectional_iteratable > {}; template struct random_access_iterator_helper : random_access_iteratable > { friend D requires_difference_operator(const T& x, const T& y) {