On Fri, Oct 7, 2011 at 04:45, Dominik Szczerba <dominik at itis.ethz.ch> wrote:
> I need to do something with - say - a Vec in a function but obviously > do not want to copy by value. Should the signature be foo(Vec) or > foo(Vec&)? > PETSc does not use C++ internally. > I see Vec is a pointer in itself, so Vec should suffice, > but in many Petsc functions I see Vec& signatures, > 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111007/1d7658f7/attachment-0001.htm>
