<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>
<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><SPAN class=920524214-16032005><FONT face=Verdana color=#0000ff size=2>You
can use an std::vector<T> where T is a SmartPointer to an object.
This is done </FONT></SPAN></DIV>
<DIV><SPAN class=920524214-16032005><FONT face=Verdana color=#0000ff
size=2>frequently in ITK.</FONT></SPAN></DIV>
<DIV><SPAN class=920524214-16032005><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=920524214-16032005><FONT face=Verdana color=#0000ff size=2>In
terms of debugging, you'll have to us more information on the how the program is
crashing (call stack, etc.) in order for us to provide more
information.</FONT></SPAN></DIV>
<DIV><SPAN class=920524214-16032005><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=920524214-16032005><FONT face=Verdana color=#0000ff
size=2>Jim</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
insight-users-bounces@itk.org [mailto:insight-users-bounces@itk.org]<B>On
Behalf Of </B>bertrand<BR><B>Sent:</B> Wednesday, March 16, 2005 9:19
AM<BR><B>To:</B> itkusers<BR><B>Subject:</B> [Insight-users] array of
SmartPointer<BR><BR></FONT></DIV>Hello all,<BR><BR>I would to how if there is
a way to create an array of SmartPointer and if there is one, how to do
that.<BR>Actually I'm looking for writing a class in which I'd like to store
some SmartPointer in an array<BR>For example in the header of the class, I
have something like :<BR><BR><I> typedef
GaussianDensityFunction< MeasurementVectorType >
DensityComponantType;<BR> typedef
DensityComponantType::Pointer
DensityComponantPointer;</I><BR><BR>In this class I use an
attribute:<BR><BR><I>
DensityComponantPointer *
m_GaussianComponents;</I><BR><BR><BR>I would like this attribute to be an
array where I could store a set of N *
<I>DensityComponantPointer<BR></I>I've tried to write something like
:<BR><BR><I> unsigned int size =
m_List->Size();<BR> m_GaussianComponents = new
DensityComponantPointer[size];<BR><BR> for ( unsigned int s
= 0; s < size; s++ ) <BR> {
<BR> this->m_GaussianComponents[size]
= DensityComponantType::New();<BR>
}<BR><BR></I>in my *.txx* file but I get a unhandled execption
when debugging it <BR>Is there a way to resolve it
??<BR><BR>Bertrand<BR> <BR></BLOCKQUOTE></BODY></HTML>