Writing Generic Container Functions in C++11
Let’s say we want to write function to append one vector to another. It can be done like, cppcopy template<typename T> void append(Vector<T>& to, const Vector<T>& from) { to.insert(to.end(), from.begin(), from.end()); }…