Re: [C++0x unique_ptr] sorting a vector of unique_ptr fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



René Bürgel <rbuergel@xxxxxx> 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.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux