From 4583e1a740b69193af3e6037c3d5cf783e967af0 Mon Sep 17 00:00:00 2001 From: 5chmidti <44101708+5chmidti@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:20:04 +0200 Subject: [PATCH] use the explicit type for iterators in return types --- test/ranges-test.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/ranges-test.cc b/test/ranges-test.cc index 209318b7..afd3c0f8 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -89,14 +89,17 @@ template class flat_set { using key_type = T; using container_type = std::vector; + using iterator = typename std::vector::iterator; + using const_iterator = typename std::vector::const_iterator; + template explicit flat_set(Ts&&... args) : c{std::forward(args)...} {} - auto begin() -> decltype(auto) { return c.begin(); } - auto begin() const -> decltype(auto) { return c.begin(); } + iterator begin() { return c.begin(); } + const_iterator begin() const { return c.begin(); } - auto end() -> decltype(auto) { return c.end(); } - auto end() const -> decltype(auto) { return c.end(); } + iterator end() { return c.end(); } + const_iterator end() const { return c.end(); } private: std::vector c;