I happen to be working on a project that uses the glm and Box2D libraries. Both of these include implementations of, for example, a 2D vector. Sometimes, I'll need to convert values from one library's format to another. I can't just write the appropriate constructors in the classes because that would involve modification of the library source code, which is a bad idea for many reasons.
Now, the obvious solution is just to write some utility functions that convert one to another, eg. convertVec2(). This would work. However, it's a bit clunky and verbose, and I can't help but wonder if there's some cleverer way of doing it, possibly using some cunning use of obscure language functionality.
Is there a better way to solve the problem? Or should I just do the boring and straightforward thing?