mentby.com
Blog | Jobs | Help | Signup | Login

Bug in GCC 4.5 c++0x version of std::list<T>::merge(&&)?



Hi,

It seems that many current uses of list<T>::merge( ) fail to compile
with -std=c++0x, but I don't see a bug in bugzilla for this.  Itseems to
result from:

list<_Tp, _Alloc>::
#ifdef __GXX_EXPERIMENTAL_CXX0X__
merge(list&& __x)
#else
merge(list& __x)
#endif

For c++0x, don't we need BOTH versions, since lvalues no longer bind to
rvalue references, or am I missing something?

-BenRI


Benjamin Redelings I Mon, 07 Dec 2009 19:39:39 -0800

Hi,
I've CC'd the libstdc   list, please reply there instead of the gcc list.

The WP only has:
void merge(list<T,Allocator>&& x);
template <class Compare> void merge(list<T,Allocator>&& x, Compare comp);

See  http://home.roadrunner.com/~hinnant/issue_review/lwg-active.[..]
which covers a similar issue with splice.

Jonathan


Jonathan Wakely Tue, 08 Dec 2009 00:27:05 -0800

When has it changed? Could you please give
a reference to some paper/discussion about it?
I'm asking, because my C++0x-based application
stopped to compile on newer 4.5-s and one of
the problems is mentioned above -- but I thought
that it was a GCC issue, not a change in the Standard.

Best regards
Piotr Wyderski


Piotr Wyderski Tue, 08 Dec 2009 01:54:48 -0800

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n284[..]

Just as an example...

Paolo.


Paolo Carlini Tue, 08 Dec 2009 02:02:05 -0800



Related Topics

Post a Comment