Namespaces
Variants
Views
Actions

Talk:cpp/container/queue/swap

From cppreference.com


> Complexity > Same as underlying container (linear if Container is std::array, constant otherwise).

Can std::array be used as an Container? The main page says otherwise

From http://en.cppreference.com/w/cpp/container/queue#Template_parameters,

> The type of the underlying container to use to store the elements. The container must satisfy the > requirements of SequenceContainer. Additionally, it must provide the following functions with the > usual semantics: > back() > front() > push_back() > pop_front()

> The standard containers std::deque and std::list satisfy these requirements.

I think you're right, updated. (the standard simply defines it in terms of the unqualified call to swap) --Cubbi (talk) 12:17, 19 November 2014 (PST)