[GiNaC-devel] Mysterious push_front()

Jan Rheinländer jrheinlaender at gmx.de
Sat Mar 5 21:36:24 CET 2022


Hi Richard,

I don't really "need" any of these patches. Just that it seems wrong to 
me that a program using exprseq::prepend() does not compile. But maybe 
that is intended because it is really inefficient?

Am 05.03.22 um 20:24 schrieb Richard B. Kreckel:
> 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.
> _______________________________________________
> GiNaC-devel mailing list
> GiNaC-devel at ginac.de
> https://www.ginac.de/mailman/listinfo/ginac-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20220305/ce882615/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20220305/ce882615/attachment.sig>


More information about the GiNaC-devel mailing list