Skip to content

Instantly share code, notes, and snippets.

@ydnax
Created June 17, 2011 08:02
Show Gist options
  • Save ydnax/1031049 to your computer and use it in GitHub Desktop.
Save ydnax/1031049 to your computer and use it in GitHub Desktop.
template <class from, class to>
to* convertContainer(const from *in){
to* ret=new to();
ret->reserve(in->size());
ret->insert(ret->end(),in->begin(),in->end());
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment