Skip to content

Commit

Permalink
Return raw pointer for etl::multi_span::operator->(). (#773)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
dhebbeker authored Oct 13, 2023
1 parent fe35751 commit e631a0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/etl/multi_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ namespace etl
//*************************************************************************
pointer operator ->()
{
return *p_value;
return &operator*();
}

//*************************************************************************
/// -> operator
//*************************************************************************
const_pointer operator ->() const
{
return *p_value;
return &operator*();
}

//*************************************************************************
Expand Down

0 comments on commit e631a0f

Please sign in to comment.