Added implementation of weak_ptr