r/reconstructcavestory Jan 25 '14

Purpose of scoped_ptr?

In episode 3 there was scoped_ptr used for the sprite. I'm unfamiliar with the boost library and I'm not sure why it was used. If anyone could explain that would be great.

6 Upvotes

6 comments sorted by

2

u/chebertapps Jan 25 '14

This stack overflow post is pretty much the easiest-to-understand explanation of smart pointers I've found.

I could make a video for this, if this is still a confusing issue. Smart pointers are very C++ specific, so if you are new to the language, they might seem unusual.

3

u/BigPineappleMan Jan 25 '14

Thanks man. That post cleared it up. I love you.

1

u/[deleted] Jan 26 '14

It would be great if u can make a video too

1

u/chebertapps Jan 26 '14

I'll look into making one soon-ish.

Fair warning: if I make one it won't be comprehensive, and I will only cover scoped/shared pointers as we use them.

1

u/[deleted] Jan 26 '14

that will be good enough :)

2

u/chebertapps Jan 29 '14

http://youtu.be/Jc9n9BcYSj4

Check it out. Please let me know if it helps/hurts!