Angus Leeming <[EMAIL PROTECTED]> writes:

| 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.

You already did, you forgot to initialize it.
(and we have done that mistake in a lot of other places as well earlier)

| I would say that this is a 
| perfectly valid use of a naked pointer.

"There is no such thing as a valid naked pointer."

-- 
        Lgb

Reply via email to