On 05/31/2010 02:36 PM, Philippe Sigaud wrote:
Simen & Marianne too: There are other concerns than simply what works. First of all is readability - having containers called queue and stack makes code easier to understand, even if this is done with a simple alias. There might also be a concern about efficiency, as there is a difference in how fast different containers can push and pop. -- Simen Yeah, particularly if having both stack and queue just costs one alias. I mean, it's a standard library. I know I can use built-in arrays (for example) as stacks and queues, but sometimes I just want to have a stack.
My opinion in the matter is that it's good to have stacks and queues just because in general sometimes it's better to have a more restricted interface.
Andrei