• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++ template pointers vs. objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >C++ template pointers vs. objects (From: Wesley Smith <email@hidden>)

  • Prev by Date: Re: Printing XCode Key Bindings list?
  • Next by Date: Weak linking vs. non-weak Linking
  • Previous by thread: Re: C++ template pointers vs. objects
  • Next by thread: Problems since migrating to xcode 2
  • Index(es):
    • Date
    • Thread