It would probably be better to use shared_ptr by reference here.