[petsc-users] passing an object to function

Jed Brown jedbrown at mcs.anl.gov
Fri Oct 7 11:10:51 CDT 2011


On Fri, Oct 7, 2011 at 11:09, Dominik Szczerba <dominik at itis.ethz.ch> wrote:

> Sorry, I could not conclude: so what signature to pass an object is
> best/cleanest/most optimal for my C++ code?
>

Prefer Vec


> Or are they all fine, e.g.
> Vec would pass address by value, Vec& would pass address by reference,
> Vec* would pass the pointer, none of them copying the heavy data?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111007/f3b5261c/attachment.htm>


More information about the petsc-users mailing list