Skip to content

Commit

Permalink
Fix tpie::packed_array cannot compile with MSVC 19.28+
Browse files Browse the repository at this point in the history
Microsoft's standard library assumes that a const version of
tpie::packed_array::iterator and similar only are immutable with respect to the
index, not the value in said index. That is, they assume the iterator reflects a
'T* const' semantics, whereas the prior version implemented a 'const T* const'
semantics."
  • Loading branch information
SSoelvsten committed Sep 22, 2023
1 parent 03447db commit 1e79d47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tpie/packed_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,18 @@ class packed_array
iter_return_type & operator*()
{ return elm; }

///////////////////////////////////////////////////////////////////////
iter_return_type & operator*() const
{ return const_cast<iter_return_type&>(elm); }

///////////////////////////////////////////////////////////////////////
iter_return_type * operator->()
{ return &elm; }

///////////////////////////////////////////////////////////////////////
iter_return_type * operator->() const
{ return &elm; }

///////////////////////////////////////////////////////////////////////
iter_base & operator=(const iter_base & o)
{
Expand Down

0 comments on commit 1e79d47

Please sign in to comment.