Originally Posted by
laserlight
One problem is that std::vector has two template parameters, not one. I am not absolutely sure about this, but it may even be possible for it to have more template parameters as a compiler extension. As such, it would be more typical to generalise this to take a range specified by iterators, and thus the template would be parameterised on the iterator type. Alternatively, you can use the container type as the template parameter, and thus the print function template will work for any container that has begin() and end() member functions that return a const_iterator.