[GiNaC-devel] Mysterious push_front()

Richard B. Kreckel kreckel at in.terlu.de
Sat Mar 5 20:24:00 CET 2022


Hi Jan,

On 05.03.22 15:18, Jan Rheinländer wrote:
> here are two patches: One for push_front() / pop_front(), the other for sort().

Are you sure you want to container<std::vector>::prepend()? It's very
slow. For std::list and std::deque, .push_front() and .insert(.begin)
seem to be equally fast. So, your first patch techniqually at least not
a regression.

Your second patch makes container::sort_(std::input_iterator_tag) use
std::sort. That seems wrong to me because std::sort requires a random
access iterator. And std::list iterators are only bidirectional, not
random access. (Note that random_access_iterator_tag is derived from
input_iterator_tag.) Could you explain why you needed this second patch?

  -richy.



More information about the GiNaC-devel mailing list