Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-02-16 12:22:53


"David Abrahams" <dave_at_[hidden]> wrote in message
news:u1xbgsbhw.fsf_at_boost-consulting.com...
| "Thorsten Ottosen" <nesotto_at_[hidden]> writes:
|

| > The trouble in that case would be that my implementation used void*
| > underneith and hence has special iterators that does a
| > reinterpret_cast.
|
| Aside: Why reinterpret_cast? Surely static_cast would be a more
| restrictive and less alarming choice.

ah yes, my mistake. I forgot static cast could do the job.

| > A reinterpret_cast appears here and there in the container's implmentation
| > too.
|
| You just need specializations for pointers that do that casting trick,
| and a generalized template that doesn't.

well, you "just" need specialization of everything, or at least a lot.

| > So given that iterators in general are not supported, would you then
prefer
| > the ptr_ prefix?
|
| No; I'd prefer if you planned to phase in support for dereferenceable
| types in general.

it might not be a bad idea. It does begs the question of how
to specify arguments. Currently you say

ptr_vector<T>

to hold T* objects. If any indirectable type should be usable, then I guess we
need to
switch to

indirect_vector<T*>
indirect_vector<std::vector<T>::iterator >

I have to think a little about how much work it will be; maybe it could wait
to the second release?

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk