This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Bugs in gcc 4.4 experimental c++0x libstdc++?
- From: "Chris Jefferson" <chris at bubblescope dot net>
- To: "Germán Diago" <germandiago at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 16 May 2008 00:13:20 +0100
- Subject: Re: Bugs in gcc 4.4 experimental c++0x libstdc++?
- References: <b798010f0805151346n3d01b049p77c30928391c5100@mail.gmail.com>
2008/5/15 Germán Diago <germandiago@gmail.com>:
> Hello. I've been using g++-4.4 from svn and I think there is a bug in
> experimental libstdc++.
>
> The function template <class... _Args> void push_back(_Args... args)
> doesn't update the vector size.
>
> And another thing I don't know if it's a bug:
>
> I used code like this:
>
>
> void f(vector<int> && arg);
>
>
> int main(int argc, char * argv[])
> {
> vector<int> v(3);
> v.push_back(1); v.push_back(2); v.push_back(3);
>
> f(move(v));
>
> }
In this case, nothing should happen by default. A rvalue reference is
like an lvalue reference in that simply passing them around does
nothing at all. Of course if in f you start doing things with 'arg',
then move constructors and such things may get called.
Chris