With quite a lot of difficulty if you're going to do it right.
The usual use-case for this is for comparison purposes, but the problem is more general than that.
There is a fairly detailed paper from C++ Report circa 2000 from Matt Austern here (PDF)