Yeah I was using this for a LIFO type system :) glad to know there is a method for this.
On Thu, Jan 7, 2016 at 12:09 AM, Dave Abrahams <[email protected]> wrote: > > On Jan 6, 2016, at 3:48 PM, Jacob Bandes-Storch <[email protected]> > wrote: > > Whoops, I meant append()/popFirst. That is, even for a single-ended queue, > you'll use one "first" operation (less efficient) and one "last" operation. > > > No, a single-ended queue is a stack. You can use append and popLast on > Array for that. > > > On Wed, Jan 6, 2016 at 3:47 PM, Dave Abrahams <[email protected]> wrote: > >> >> On Jan 6, 2016, at 3:42 PM, Jacob Bandes-Storch <[email protected]> >> wrote: >> >> Oops, I forgot this existed. >> >> I'm assuming you're recommending popLast for performance reasons? >> Unfortunately, for a >> >> >> …double-ended… >> >> queue, you'll need either insertAtIndex(0)/popLast or append()/popLast >> (or a different data structure)… >> >> >> Yes, the standard library should acquire a Deque data structure at some >> point. >> > > Is there a SR for this? > > > Not that I know of; have at it! > > -Dave > > > > -- Wizard [email protected] +44 7523 279 698
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
