You can make the vector a parametric type, that should avoid the code duplication. The parametric example should show how to do this.
For what it’s worth, built-in support for std::vector (and others) is on my todo list, but unfortunately my time for working on it has been limited lately.