arximboldi / immer

Postmodern immutable and persistent data structures for C++ — value semantics at scale
https://sinusoid.es/immer
Boost Software License 1.0
2.48k stars 177 forks source link

vector::iterator + X expects X to be int, not size_type #232

Closed jsyjr closed 1 year ago

jsyjr commented 1 year ago

I have not investigated other iterators nor other containers but would expect the issue to be relatively widespread.

arximboldi commented 1 year ago

Is it int or std::ptrdiff_t (aka iterator_traits::difference_type)? Note that size_type is unsigned so it is actually unsuitable for operator+.

jsyjr commented 1 year ago

Learn something new everyday. Thanks for the quick reply.

arximboldi commented 1 year ago

Glad it helped!