public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Sergei Trofimovich <st@anti-virus.by>
To: gcc-bugs@gcc.gnu.org
Subject: [resend][stl] std::vector::data - nonstandard method.
Date: Fri, 31 Oct 2008 13:40:00 -0000	[thread overview]
Message-ID: <20081031153859.00158590@st.vba.com.by> (raw)

[-- 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 --]

                 reply	other threads:[~2008-10-31 13:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081031153859.00158590@st.vba.com.by \
    --to=st@anti-virus.by \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).