Sign in to follow this  

boost::shared_ptr without including boost

This topic is 2643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Stupid title, but... Me and another guy are working on a very short-term project and send the project to each other via email. The other guy isn't familiar with C++ and so hasn't deleted any allocated memory. I want to grab boost::shared_ptr to fix this, but I don't want the huge amount of files and crap that comes with it.

Is it possible to take a few files (all shared_ptr related ones) from boost and still have it compile?

Cheers.

Share this post


Link to post
Share on other sites
Well, since shaded_ptr is just a template, everything should be included in the handful of header files associated with shared_ptr. However, you cannot just spam shared_ptr and expect that to work for memory management. There are many ways that shared_ptr can fail to deallocate memory, and I wouldn't trust any C++ project I was working on to someone who doesn't understand memory allocation.

Also, have you considered a team management solution such as SVN or Git? You really shouldn't be using email to manage code.

Also, your should't ever have to include the Boost libraries with the project. All you need to do is put it in the classpath on both of the systems.

Share this post


Link to post
Share on other sites
Quote:
Original post by generaleskimo
Well, since shaded_ptr is just a template, everything should be included in the handful of header files associated with shared_ptr. However, you cannot just spam shared_ptr and expect that to work for memory management. There are many ways that shared_ptr can fail to deallocate memory, and I wouldn't trust any C++ project I was working on to someone who doesn't understand memory allocation.

Also, have you considered a team management solution such as SVN or Git? You really shouldn't be using email to manage code.

Also, your should't ever have to include the Boost libraries with the project. All you need to do is put it in the classpath on both of the systems.

You're right... I forgot that you don't need to bundle any boost stuff with the project. :s So as long as he has boost we should be fine...

I can show him how and when to use it, it's not a nuclear weapon. :p

As I said, the project is very short term. It will be finished in a few days so email is fine for what we are doing.

Share this post


Link to post
Share on other sites
If you're both using a recent enough C++ compiler you don't even need boost. You can grab tr1's shared_ptr.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mybowlcut
send the project to each other via email.


GET DROPBOX.

Or some real version management system. git, svn, ....

Share this post


Link to post
Share on other sites
Sign in to follow this