On 22.03.21 22:03, Richard B. Kreckel wrote:
On 22.03.21 10:32, Vitaly Magerya wrote:
On 21/03/2021 13:10, Richard B. Kreckel wrote:
Does the attached patch work for you?
Yeah, that seems to work.
Great!
The little "beauty" attached to this email fixes it, too. What happens is that, within basic::collect(const ex& s), s.operator[i] calls ex::operator[](size_t) const, i.e. the const overload, as the author apparently expected. So far, so good. But, contrary to what the author of said operator[] expected, it does not call basic::operator[](size_t) const for two slightly surprising reasons: 1) ex::bp is of type ptr<basic>, not of type const ptr<basic>, 2) ptr<basic>::operator*() returns a basic &, not a const basic &. Well, this is @%o&X#$* brain-dead. -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>