From 5ac0c7c799691a5cc2de1b35e096f4bd141ad34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 21 Sep 2020 11:39:26 +0200 Subject: [PATCH] List.hpp: let operator* return a reference So that clang 12 does not complain: loop variable 'child' is always a copy because the range of type 'List' does not return a reference --- src/include/containers/List.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/containers/List.hpp b/src/include/containers/List.hpp index df9f584294..97cd483f4d 100644 --- a/src/include/containers/List.hpp +++ b/src/include/containers/List.hpp @@ -126,12 +126,12 @@ public: operator T() const { return node; } operator T &() { return node; } - T operator* () const { return node; } + const T &operator* () const { return node; } Iterator &operator++ () { if (node) { node = node->getSibling(); - }; + } return *this; }