<div dir="ltr"><div class="gmail_quote">On Tue, Apr 5, 2011 at 04:24, Dmitry Karpeev <span dir="ltr"><<a href="mailto:karpeev@mcs.anl.gov">karpeev@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>I don't know whether C++ does the same (there is the issue of where it sticks the vtable, and I'm not sure what else).</div>

<div>I imagine there will be no problem, since we've been compiling the PETSc C code with C++ compilers for a decade now,</div><div>but I don't know whether the C++ standard guarantees that.  Jed is the only person I know that actually reads the standard</div>


<div>(or maybe it's part of the ABI).</div></blockquote></div><br><div>As far as the implementation, there is no vtable because we don't put C++ virtual methods in the struct. The standard does not say anything about the existence of a vtable, but it does make the same sort of guarantees about struct layout. I do not know if you can guarantee that a struct within an extern "C" block is binary compatible with a struct outside an extern "C" block that does not happen to contain a vtable.</div>
</div>