I come to know that when many objects shares same data and creation and desturction of objects are expensive then one can go for reference counting .
Can anybody give input about how to achieve it for the library class which cant be changed ?.
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.
Use a referenced-counted pointer like
boost::shared_ptr. No changes to the class pointed to are necessary, but you will be limited to creating class instances dynamically.