The C++ iterator library contains the back_insert_iterator which is an output-iterator calling push_back
on its container. I can use it together with containers like vector
, deque
or list
which makes the usage of algorithms like std::copy
quite 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
push
and notpush_back
? - If it is named
push
, why not provide a specializedback_insert_iterator
forqueue
?