|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-04-28 14:31:39
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:011801c54c25$f9f3c2d0$6401a8c0_at_pdimov2...
| Howard Hinnant wrote:
| > I've got 3 ownership policies on my mind:
| >
| > 1. shared
| > 2. unique
| > 3. cloned
| >
| > And if anything I'm leaning towards shallow const on all of them.
| > However I also believe deep const versions of all of these would
| > probably be valuable as well. And I'm especially looking at
| > signatures like:
| >
| > template<class T, class U>
| > bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b);
| >
| > shared_ptr today is a shallow const animal, and I think that is good.
| > But the above signature assumes deep const. It would be nice to have
| > a zero-overhead way to express and enforce that assumption.
|
| I'm not sure I understand. Why does the above assume deep const? It's just
| the shared_ptr equivalent of:
|
| template<class T, class U>
| bool operator==(T * const & a, U * const & b);
it's unreasable to requrie the state of T and U to be avaiable through
non-const member functions.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk