public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christopher Jefferson <chris@bubblescope.net>
To: Ian Lance Taylor <iant@google.com>
Cc: "René Bürgel" <rbuergel@web.de>, gcc-help@gcc.gnu.org
Subject: Re: [C++0x unique_ptr] sorting a vector of unique_ptr fails
Date: Mon, 15 Dec 2008 20:22:00 -0000	[thread overview]
Message-ID: <17258D4C-5179-4435-81C0-8891B55A06A5@bubblescope.net> (raw)
In-Reply-To: <m3bpvdfdal.fsf@google.com>


On 15 Dec 2008, at 19:28, Ian Lance Taylor wrote:

> René Bürgel <rbuergel@web.de> writes:
>
>> Is the following code supposed to work in C++0x-Mode or am i just
>> doing something wrong?
>>
>> #include <memory>
>> #include <vector>
>> #include <algorithm>
>>
>> int main()
>> {
>>       std::vector<std::unique_ptr<int> > v;
>>       std::sort(v.begin(), v.end());
>> }
>
> I think it is supposed to work.  The standard says that the value
> must be Swappable, MoveConstructible, and MoveAssignable.  I think
> that std::unique_ptr meets those requirements.
>
> I think this is a bug in libstdc++-v3.  Looking at the code, I think
> this means that __introsort_loop can't assume that it can pass values
> to std::__median.


It is a "bug" in that not all of libstdc++-v3 has been updated to C+ 
+0x. Sort is one such example.

Chris

  reply	other threads:[~2008-12-15 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-13 17:35 René Bürgel
2008-12-15 19:30 ` Ian Lance Taylor
2008-12-15 20:22   ` Christopher Jefferson [this message]
2008-12-15 23:46     ` René Bürgel
2008-12-16  6:14       ` Ian Lance Taylor
2008-12-17  0:44         ` René Bürgel
2008-12-17  0:50           ` Diego Novillo
2008-12-17  1:06             ` Diego Novillo

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=17258D4C-5179-4435-81C0-8891B55A06A5@bubblescope.net \
    --to=chris@bubblescope.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=rbuergel@web.de \
    /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).