> 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] > <mailto:[email protected]>> wrote: > >> On Jan 6, 2016, at 3:42 PM, Jacob Bandes-Storch <[email protected] >> <mailto:[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
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
