I'm still not really convinced that this is better than "%04x", it is much much more verbose. Wouldn't it be possible to keep mostly the same short syntax, but gain typesafeness, using boost::format?