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
nbecker@fred.net writes:
[...]
| 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.
I understand your need. The syntax above should cuure your problem.
| Are there any other STL-compatible containers that have the required
| properties?
Not STL, but valarray<T> meets the contiguous memory requirement. But
as I said in another message, in practice vector<T> will do and by the
next TC it should.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com