From da8c12a4ef5f363da8a3004c9b272d54b4c6e03d Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Thu, 21 Nov 2024 09:33:42 +0800 Subject: [PATCH] Avoid obsolescent features in `push_iterator` --- qcrt/include/util/util_iterator.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qcrt/include/util/util_iterator.h b/qcrt/include/util/util_iterator.h index 122d771..878ba82 100644 --- a/qcrt/include/util/util_iterator.h +++ b/qcrt/include/util/util_iterator.h @@ -6,7 +6,7 @@ namespace util { template - class push_iterator : public std::iterator + class push_iterator { public: @@ -15,6 +15,10 @@ namespace util typedef container container_type; typedef typename container::const_reference const_reference; typedef typename container::value_type value_type; + typedef std::output_iterator_tag iterator_category; + typedef void difference_type; + typedef void pointer; + typedef void reference; explicit push_iterator(container& cont) : m_container(&cont) @@ -60,6 +64,7 @@ namespace util }; } +#if defined(_MSC_VER) && _MSC_VER < 1915 namespace std { template @@ -69,5 +74,6 @@ namespace std // mark push_iterator as checked }; } +#endif -#endif \ No newline at end of file +#endif