<div class="gmail_quote">On Fri, Oct 7, 2011 at 04:45, Dominik Szczerba <span dir="ltr"><<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":1ps">I need to do something with - say - a Vec in a function but obviously<br>
do not want to copy by value. Should the signature be foo(Vec) or<br>
foo(Vec&)?</div></blockquote><div><br></div><div>PETSc does not use C++ internally.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":1ps">
I see Vec is a pointer in itself, so Vec should suffice,<br>
but in many Petsc functions I see Vec& signatures, </div></blockquote><div><br></div><div>No, you see some Vec* signatures, not Vec&. Vec* is used when a new Vec is created, if the function needs to modify the pointer, or if the argument is an array of Vecs.</div>
</div>