<div dir="ltr">On 26 September 2013 10:03, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)">Another example is object::ObjectFile.  You can cast<> or dyn_cast<> these down to object::COFFObjectFiles or object::MachOObjectFiles easily, but object::ELFObjectFile is a template class and there's no documentation of what the template parameter should be, of it if's possible to infer it from the object::ObjectFile somehow.</span></div>
</blockquote><div><br></div><div>This strikes me as poor design, helped by the fact that there was no expected API or documentation on how to use it, so special implementations will differ and become incompatible with each other. Per se, it's not a problem, but when you change the interface, (or when trying to use polymorphism), things can go wrong in mysterious ways.</div>
<div><br></div><div>A few lines of comments saying what's expected from the derived classes would have prompted folks to work around the template problems (or found a different solution) before it became an issue.</div>
<div><br></div><div>cheers,</div><div>--renato</div></div></div></div>