I have an arbitrary STL container C, which contains elements of an arbitrary type T. I want to create an std::vector that has a copy of all the elements. What is the cleanest way to do this?
template <typename C>
void myfunction(C container){
/*Derive the type T of elements within the container*/
std::vector<T> mystack;
/* Iterate over container and push_back() the elements into mystack*/
}