On 10/07/2019 10:11 AM, Just Dave wrote:
I need a stack and a queue

There is a DoubleEndedQueue example under "Indexing Operators" here:


http://ddili.org/ders/d.en/operator_overloading.html#ix_operator_overloading.opIndexOpAssign

It does not have the pop varieties but it should be trivial to add those because it internally uses two slices and the "head" of the whole container is the actual "end" of one of those slices. (The elementAt() member function takes care of reversed indexing for half of the elements.)

I stole the idea of that example from Chuck Allison after one of his DConf presentations.

Ali

Reply via email to