This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libstc++-v3 vector not convertible to pointer
>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
Gabriel> nbecker@fred.net writes:
Gabriel> | I see that in libstdc++-v3 (current cvs) a vector::iterator is no
Gabriel> | longer compatible with a pointer.
Gabriel> There is nothing in the Standard which says it should be -- actually
Gabriel> an implementation of quality won't use a plain pointer.
Gabriel> | ... Specifically, this won't work:
Gabriel> |
Gabriel> | reinterpret_cast<fftw_real*>(in.begin())
Gabriel> No one should be writing things like that.
Gabriel> If you want to access the address of the first element, then just say
Gabriel> &in[0]
Gabriel> as you would have, were `in' a C-like array.
I want to interoperate with existing C libraries that expect a
pointer. High performance computing requires this (at least for
now). My point is not that there is anything wrong with libstdc++.
For high performance we need a different vector-like container that
does interoperate with C.
Are there any other STL-compatible containers that have the required
properties?