This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



I disagree that it is unbelievable ;)

It is not a good idea to want vector::iterator to be restricted to T*.
Such a restriction would rule out "safe" implementations of STL, such as
STLport in debug mode.

On Thu, 30 Nov 2000, Geoffrey Furnish wrote:
> nbecker@fred.net writes:
>  > I see that in libstdc++-v3 (current cvs) a vector::iterator is no
>  > longer compatible with a pointer.  Specifically, this won't work:
>  > 
>  > reinterpret_cast<fftw_real*>(in.begin())
>  > 
>  > where in is vector.begin() and fftw_real is double.
>  > 
>  > Is there any alternative class I could use?  This seems to be a
>  > fundamental need for high performance computing, since we still we
>  > need to interoperate with C for some time to come.
> 
> :-).  It is really unbelievable, isn't it?  Note, however, that this
> implementation choice does not violate the standard.  
> 
> It still stores the data contiguously (for now?  cross your
> fingers...), so you can always do something like:
> 
> fftw_real *inbegin = &in[0];
> 
> or even:
> 
> fftw_real *inbegin = &(*in.begin());
> 
> -- 
> Geoffrey Furnish            Actel Corporation        furnish@actel.com
> Senior Staff Engineer      955 East Arques Ave       voice: 408-522-7528
> Placement & Routing     Sunnyvale, CA   94086-4533   fax:   408-522-8041
> 
> --------------------- 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
> 

----------------------------------------------------------------------
 Jeremy Siek                        www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate                  email: jsiek@lsc.nd.edu
 Univ. of Notre Dame         work phone: (219) 631-3906
----------------------------------------------------------------------



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]