Is boost shared_ptr thread safe?

boost::shared_ptr<> offers a certain level of thread safety. The reference count is manipulated in a thread safe manner (unless you configure boost to disable threading support). So you can copy a shared_ptr around and the ref_count is maintained correctly. What you cannot do safely in multiple threads is modify the actual shared_ptr object instance itself … Read more

Explicitly deleting a shared_ptr

Your question isn’t clear. If you’ve allocated a shared_ptr dynamically then you’re certainly allowed to delete it whenever you want. But if you’re asking whether you’re allowed to delete whatever object is being managed by the shared_ptr, then the answer is … it depends. If shared_ptr::unique returns true, then calling shared_ptr::reset will delete the managed … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)