[petsc-users] passing an object to function

Dominik Szczerba dominik at itis.ethz.ch
Fri Oct 7 04:45:28 CDT 2011


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&)? I see Vec is a pointer in itself, so Vec should suffice,
but in many Petsc functions I see Vec& signatures, so I am a bit
confused.
Thanks for any clarifications.

Dominik


More information about the petsc-users mailing list