From edfa329e64cb0e4cf34fef6995a57b2a2e22d690 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 5 Nov 2023 00:24:25 +0100 Subject: [PATCH] util/DereferenceIterator: use *declval() to guess the default value type This allows the iterator to point to another iterator. --- src/util/DereferenceIterator.hxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util/DereferenceIterator.hxx b/src/util/DereferenceIterator.hxx index a45e293d6..6bdc82a32 100644 --- a/src/util/DereferenceIterator.hxx +++ b/src/util/DereferenceIterator.hxx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann -#ifndef DEREFERENCE_ITERATOR_HXX -#define DEREFERENCE_ITERATOR_HXX +#pragma once #include #include @@ -12,7 +11,7 @@ * original iterator. */ template::type> + typename VT=std::remove_reference_t::value_type>())>> class DereferenceIterator { using Traits = std::iterator_traits; @@ -86,5 +85,3 @@ public: return original != other.original; } }; - -#endif