Uncategorized

  1. 2016

  2. Writing Generic Container Functions in C++11

    3 min read

    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()); }…