I've compiled and run your example on my VC 7.1 setup using the the version in the HEAD and it compiles and executes fine. Your experiments suggest that it is a compiler dependent issue. So I can't pinpoint anything. However, I could offers some suggestions on your example which might or might not help. Feel free to accept or reject them. Your example looks correct to me. But includes a number of behaviors which to me are a little non-obvious to me and I sort of distrust compilers to get it right when its not obvious to me. a) I wouldn't have named a function string serialize(...). I'm concerned about the compiler getting the overloading wrong. At the very least it makes the example harder to understand. b) The following bit: string serialize(const base * const b){