Commit 41d3a0c3 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/12967 (Resolution of DR 300 [WP] still unimplemented)

2003-11-08  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/12967
	* include/bits/list.tcc (merge): Implement resolution of
	DR 300 [WP].
	* docs/html/ext/howto.html: Add entry for DR 300; tweak entry
	for DR 231.

	* docs/html/ext/lwg-active.html, docs/html/ext/lwg-defects.html:
	Import R27.

From-SVN: r73377
parent b9bc3665
2003-11-08 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/12967
* include/bits/list.tcc (merge): Implement resolution of
DR 300 [WP].
* docs/html/ext/howto.html: Add entry for DR 300; tweak entry
for DR 231.
* docs/html/ext/lwg-active.html, docs/html/ext/lwg-defects.html:
Import R27.
2003-11-07 Jonathan Wakely <redi@gcc.gnu.org>
* libsupc++/vec.cc: Conform to C++STYLE.
......
......@@ -593,7 +593,7 @@
for const instances.
</dd>
<dt><a href="lwg-active.html#231">231</a>:
<dt><a href="lwg-defects.html#231">231</a>:
<em>Precision in iostream?</em>
</dt>
<dd>For conversion from a floating-point type, <code>str.precision()</code>
......@@ -646,6 +646,11 @@
<dd>If <code>(this == &amp;rhs)</code> do nothing.
</dd>
<dt><a href="lwg-defects.html#300">300</a>:
<em>List::merge() specification incomplete</em>
</dt>
<dd>If <code>(this == &amp;x)</code> do nothing.
</dd>
<!--
<dt><a href="lwg-defects.html#"></a>:
<em></em>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -249,21 +249,26 @@ namespace std
list<_Tp,_Alloc>::
merge(list& __x)
{
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
{
iterator __next = __first2;
_M_transfer(__first1, __first2, ++__next);
__first2 = __next;
}
else
++__first1;
if (__first2 != __last2)
_M_transfer(__last1, __first2, __last2);
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 300. list::merge() specification incomplete
if (this != &__x)
{
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
{
iterator __next = __first2;
_M_transfer(__first1, __first2, ++__next);
__first2 = __next;
}
else
++__first1;
if (__first2 != __last2)
_M_transfer(__last1, __first2, __last2);
}
}
// FIXME put this somewhere else
......@@ -351,20 +356,26 @@ namespace std
list<_Tp,_Alloc>::
merge(list& __x, _StrictWeakOrdering __comp)
{
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1))
{
iterator __next = __first2;
_M_transfer(__first1, __first2, ++__next);
__first2 = __next;
}
else
++__first1;
if (__first2 != __last2) _M_transfer(__last1, __first2, __last2);
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 300. list::merge() specification incomplete
if (this != &__x)
{
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1))
{
iterator __next = __first2;
_M_transfer(__first1, __first2, ++__next);
__first2 = __next;
}
else
++__first1;
if (__first2 != __last2)
_M_transfer(__last1, __first2, __last2);
}
}
template<typename _Tp, typename _Alloc>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment