From 52c97d387264a48cb63ae47ee0694ed1ec906c4f Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Thu, 12 Oct 2023 15:55:49 +0200 Subject: [PATCH] Return raw pointer for `etl::multi_span::operator->()`. - using `operator*()` in case getting the current element is changed one day - using `&` to get the address Simply returning `p_value` may break in case the internal type of `p_value` would change. This way it is more robust to changes. --- include/etl/multi_span.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/etl/multi_span.h b/include/etl/multi_span.h index c24e893a1..7f98865dc 100644 --- a/include/etl/multi_span.h +++ b/include/etl/multi_span.h @@ -134,7 +134,7 @@ namespace etl //************************************************************************* pointer operator ->() { - return *p_value; + return &operator*(); } //************************************************************************* @@ -142,7 +142,7 @@ namespace etl //************************************************************************* const_pointer operator ->() const { - return *p_value; + return &operator*(); } //*************************************************************************