$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] shared_ptr as reference argument
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-19 12:30:42
> Is there some utility in passing shared_ptr's as references as here:
>
> void bla(boost::shared_ptr<T>& bla_ptr);
>
> This avoids creating of a new object and copying overhead, but is it
> safe? When would you recommend it and when not?
Passing object by reference means you want to modify it inside the
function. If you only want to avoid overhead, pass it by const
reference.