Open SSoelvsten opened 11 months ago
A simple hack would be to add (with a 1928 <=_MSC_VER
preprocessor guard?) the following to the tpie::iter_base
class for the tpie::packed_array
.
iter_return_type & operator*() const
{return const_cast<iter_return_type&>(elm);}
iter_return_type * const operator->() const
{return &elm;}
If I should be the devil's advocate for Microsoft, I guess the 19.28+ version is based on const iterator_t
is supposed to be akin to a T* const
whereas TPIE's iterator is a (const T)* const
, i.e. the const should only refer to the pointer, not to the pointed value.
With any 19.28+ version of Microsoft's compiler, we get some kind of error similar to the following.
This is due to a conflict between
tpie::packed_array
, its iterator, and Microsoft's implementation of thestd::sort
(shown below). Specifically, the lines with*_First = _STD move(_Val);
, and*_Hole = _STD move(*_Prev)
try to write into an iterator that has been marked asconst
(see the declaration).This has been identified as part of pull request #257 . But, fixing this issue seems out-of-scope for "Adding CI"? Furthermore, I have no idea how to fix it without any kind of hacks.