OON: Re: libstc++-v3 vector not convertible to pointer

From: Falk Hueffner (falk.hueffner@student.uni-tuebingen.de)
Date: Thu Nov 30 2000 - 09:44:15 EST


On 30 Nov 2000, Alexandre Oliva wrote:
> On Nov 30, 2000, nbecker@fred.net wrote:
> > I see that in libstdc++-v3 (current cvs) a vector::iterator is no
> > longer compatible with a pointer.
>
> And, in fact, it shouldn't be.
>
> > reinterpret_cast<fftw_real*>(in.begin())
>
> Try `& * in.begin()'.

I think &in[0] would be more readable.

> IIRC, vectors have to be contiguous, even though the Standard doesn't
> explicitly state that.

How do you mean that? If the standard doesn't explicitely state it, they
don't have to, I would think. OTOH, the standard commitee seems to
have specified that vector elements *have* to be adjacent in memory. See
http://x60.deja.com/threadmsg_ct.xp?AN=697599163.1&mhitnum=6&CONTEXT=975595224.1799946246

        Falk

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:14 EST