On Wednesday 27 November 2002 2:48 pm, Lars Gullik Bjønnes wrote: > But do we like all these bald pointers? > > void ControlMath::showDaughter(void * key) > { > Store::iterator it = daughters_.find(key); > weak_ptr<GUIMathSub> new_active = > (it == daughters_.end()) ? 0 : it->second; > > if (active_ != new_active) { > if (active_ ) > active_->controller().hide(); > active_ = new_active; > } > > if (active_) > active_->controller().show(); > } > > or?
Lars, it's a private variable that is used only privately. The store is also private, so we can't possibly go wrong here. I would say that this is a perfectly valid use of a naked pointer. There's no need to make things complicated just for the sake of making things complicated. There has to be a real reason too... Angus