The C++ iterator library contains the back_insert_iterator which is an output-iterator calling push_backon its container. I can use it together with containers like vector, dequeor listwhich makes the usage of algorithms like std::copyquite handy. Now I wanted to use a queue which does not have a function push_back but only a function push. I am wondering:
- Why is the member function called
pushand notpush_back? - If it is named
push, why not provide a specializedback_insert_iteratorforqueue?