Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decent shared_ptr implementation that does not require a massive library?

Tags:

c++

shared-ptr

I am taking a C++ programming class right now on GIS Programming. I am really starting to get alot of headaches from dealing with proper memory management. Considering at any time there is often 8-10 classes each holding a pointer to a 3D matrix or something else very large. Now our class already raised the issue of the prof allowing us to use Boost, or atleast the C++ Feature Pack for 2008(for TR1). He refused but said if we wanted to we can find add a few third party cpp/hpp files. I already tried looking at getting shared_ptr out of boost but that is more of a headache than its worth.

So is there any sort of free shared_ptr implementation out there?

like image 625
UberJumper Avatar asked Oct 03 '09 01:10

UberJumper


2 Answers

Use boost's bcp tool. It will let you extract certain functionality from the boost libraries.

bcp shared_ptr /boost_shared_ptr

will extract shared_ptr and it's dependencies to that directory.

like image 116
joshperry Avatar answered Sep 21 '22 17:09

joshperry


Give Lokis ref-counted smart pointer a shot - as far as i recall its less coupled then boosts headers.

like image 30
Georg Fritzsche Avatar answered Sep 22 '22 17:09

Georg Fritzsche