[Insight-users] : how to pass a smart pointer as a function argument

Yannick Pannier pannier at lms.polytechnique.fr
Tue Mar 11 10:29:25 EDT 2008


Hi,

It is a basic question, sorry...
What is the syntax to declare and pass a smart pointer as a reference 
argument of a function :
is it someting like this :
int main ()
 {
ITK_objectType::Pointer object1 = ITK_objectType::New();
object1->SetReferenceCount(2);
function(object1);
// object1 modified
}

void function(ITK_objectType::Pointer object)
{//modify object1}

Thanks,
Yannick




More information about the Insight-users mailing list