From d26ba19006596d7e97e68dfcca38305c4fc1700f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 19 Jan 2018 21:11:49 +0100 Subject: sc: std::iterator is deprecated in C++17 Change-Id: I947dcf61e95bdc68d19eab7daca4c31ba8047d5e Reviewed-on: https://gerrit.libreoffice.org/48224 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sc/inc/table.hxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 12a961b59a59..8f84fd475782 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -121,15 +121,16 @@ struct ScInterpreterContext; class ScColumnsRange final { public: - class Iterator final : public std::iterator< - std::input_iterator_tag, // iterator_category - SCCOL, // value_type - SCCOL, // difference_type - const SCCOL*, // pointer - SCCOL> // reference + class Iterator final { std::vector::const_iterator maColIter; public: + typedef std::input_iterator_tag iterator_category; + typedef SCCOL value_type; + typedef SCCOL difference_type; + typedef const SCCOL* pointer; + typedef SCCOL reference; + explicit Iterator(std::vector::const_iterator colIter) : maColIter(colIter) {} Iterator& operator++() { maColIter++; return *this;} @@ -137,7 +138,7 @@ class ScColumnsRange final bool operator==(Iterator other) const {return maColIter == other.maColIter;} bool operator!=(Iterator other) const {return !(*this == other);} - reference operator*() const {return (*maColIter)->GetCol();} + SCCOL operator*() const {return (*maColIter)->GetCol();} }; ScColumnsRange(Iterator nBegin, Iterator nEnd) : maBegin(nBegin), maEnd(nEnd) {} -- cgit