public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [resend][stl] std::vector::data - nonstandard method.
@ 2008-10-31 13:40 Sergei Trofimovich
  0 siblings, 0 replies; only message in thread
From: Sergei Trofimovich @ 2008-10-31 13:40 UTC (permalink / raw)
  To: gcc-bugs

[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]

Hi, today i've occasionally wrote importable code :]

std::vector::data() is absent in some other (standard conformant?) STLs.

Would be a good idea to rename data() or change specifier (-> protected?).

g++ -v:
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured
with: /var/tmp/portage/sys-devel/gcc-4.3.2/work/gcc-4.3.2/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--disable-altivec --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror
--enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-cld --disable-libgcj
--enable-languages=c,c++,treelang,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.2
p1.0'

Thanks!

----
// source example:
#include <vector>
#include <algorithm>
#include <functional>
#include <iostream>

void f()
{
    std::vector<int> v(1);
    std::cout

        // vvvvvvvvvvvvvvv
        << v.data() // nonstandard method (compiles, works)
        //^^^^^^^^^^^^^^^^

        << std::endl;
}

int main()
{
    f();
}

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-31 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-31 13:40 [resend][stl] std::vector::data - nonstandard method Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).