Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2000-01-25 16:00:06

> Hmm... I mean really hmm. smart_ptr as it stands now says:
> shared_ptr(const shared_ptr& r) throw() : px(r.px) { ++*(pn =; }
> Now, will somebody explain to me how can you do:
> pn =;
> when pn is not const and r (and therefore is const.

The pointer is const. But what's pointed to is not const. So if we are
talking about shared_ptr<int>, pn is of type "int *" and is of type
"int * const". There would be a problem if was a pointer to a const
int, "int const *" or "const int *", but it's not.

    -- Darin

Boost list run by bdawes at, gregod at, cpdaniel at, john at