I want to start using smart pointers in my code but I don’t really want to use Boost because it’s so huge.
Can anyone recommend a simple, one-file smart pointer implementation?
Thanks, Boda Cydo.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately, smart pointers are not all that simple, so the implementation may be quite complicated. Having said that, if you are using g++ you get things like shared_ptr without having to use Boost:
but you will have to compile with the
-std=c++0xflag.