Re: C++ template pointers vs. objects
Re: C++ template pointers vs. objects
- Subject: Re: C++ template pointers vs. objects
- From: Keith Ray <email@hidden>
- Date: Thu, 26 May 2005 16:34:15 -0700
A third option would be:
std::vector< boost::shared_ptr< largeObject > > objVect;
That gets you a vector of smart pointers, and saves you from writing
code to delete pointers that are held in the vector. Code you don't
have to write is has fewer bugs.
On 5/25/05, Wesley Smith <email@hidden> wrote:
> Hi,
>
> What is best practice in C++ when using templates and large
> objects...is it to declate a vector of pointers to an object or a
> vector of objects as in:
>
> std::vector<largeObject *> objvect;
>
> or
>
> std::vector<largeObject> objvect;
>
> thanks,
> wes
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
C. Keith Ray
<http://homepage.mac.com/keithray/blog/index.html>
<http://homepage.mac.com/keithray/xpminifaq.html>
<http://homepage.mac.com/keithray/resume2.html>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden