how can i pass an iterator to a template function and create local container that has same type as the iterator?