summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-01-25 16:09:25 +0200
committerJuha Vuolle <juha.vuolle@insta.fi>2021-01-28 14:02:33 +0200
commit440a05cfd1a5e409ed779e6f093c2cebfb94c4de (patch)
tree97573cd3d1aa34a11ff6dd67d56d31d0ea97ab78
parent877517d80cc325a06555dcdb987d7cd5d2b8d72f (diff)
Fix std::iterator deprecation warning with MSVC19
C++17 depreceates std::iterator class for inheriting (warning STL4015) Task-number: QTBUG-89832 Change-Id: I27c0c4796239f409c02114b646c2c94151dafdea Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r--src/scxml/qscxmlexecutablecontent_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/scxml/qscxmlexecutablecontent_p.h b/src/scxml/qscxmlexecutablecontent_p.h
index 5980330..1477769 100644
--- a/src/scxml/qscxmlexecutablecontent_p.h
+++ b/src/scxml/qscxmlexecutablecontent_p.h
@@ -404,11 +404,17 @@ struct StateTable {
return *(start + idx + 1);
}
- struct const_iterator: public std::iterator<std::forward_iterator_tag, int, ptrdiff_t,
- const int *, const int &>
+ struct const_iterator
{
const_iterator(const Array &a, int pos): a(a), pos(pos) {}
+ // std::iterator_traits
+ using value_type = int;
+ using pointer = const int*;
+ using reference = const int&;
+ using difference_type = std::ptrdiff_t;
+ using iterator_category = std::forward_iterator_tag;
+
const_iterator &operator++() {
if (pos < a.size()) ++pos;
return *this;