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
This commit is contained in:
Paolo Carlini 2003-11-08 21:17:30 +00:00 committed by Paolo Carlini
parent b9bc36658c
commit 41d3a0c3d8
5 changed files with 6982 additions and 4837 deletions

View File

@ -1,3 +1,14 @@
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> 2003-11-07 Jonathan Wakely <redi@gcc.gnu.org>
* libsupc++/vec.cc: Conform to C++STYLE. * libsupc++/vec.cc: Conform to C++STYLE.

View File

@ -593,7 +593,7 @@
for const instances. for const instances.
</dd> </dd>
<dt><a href="lwg-active.html#231">231</a>: <dt><a href="lwg-defects.html#231">231</a>:
<em>Precision in iostream?</em> <em>Precision in iostream?</em>
</dt> </dt>
<dd>For conversion from a floating-point type, <code>str.precision()</code> <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>If <code>(this == &amp;rhs)</code> do nothing.
</dd> </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>: <dt><a href="lwg-defects.html#"></a>:
<em></em> <em></em>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -249,21 +249,26 @@ namespace std
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
merge(list& __x) merge(list& __x)
{ {
iterator __first1 = begin(); // _GLIBCXX_RESOLVE_LIB_DEFECTS
iterator __last1 = end(); // 300. list::merge() specification incomplete
iterator __first2 = __x.begin(); if (this != &__x)
iterator __last2 = __x.end(); {
while (__first1 != __last1 && __first2 != __last2) iterator __first1 = begin();
if (*__first2 < *__first1) iterator __last1 = end();
{ iterator __first2 = __x.begin();
iterator __next = __first2; iterator __last2 = __x.end();
_M_transfer(__first1, __first2, ++__next); while (__first1 != __last1 && __first2 != __last2)
__first2 = __next; if (*__first2 < *__first1)
} {
else iterator __next = __first2;
++__first1; _M_transfer(__first1, __first2, ++__next);
if (__first2 != __last2) __first2 = __next;
_M_transfer(__last1, __first2, __last2); }
else
++__first1;
if (__first2 != __last2)
_M_transfer(__last1, __first2, __last2);
}
} }
// FIXME put this somewhere else // FIXME put this somewhere else
@ -351,20 +356,26 @@ namespace std
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
merge(list& __x, _StrictWeakOrdering __comp) merge(list& __x, _StrictWeakOrdering __comp)
{ {
iterator __first1 = begin(); // _GLIBCXX_RESOLVE_LIB_DEFECTS
iterator __last1 = end(); // 300. list::merge() specification incomplete
iterator __first2 = __x.begin(); if (this != &__x)
iterator __last2 = __x.end(); {
while (__first1 != __last1 && __first2 != __last2) iterator __first1 = begin();
if (__comp(*__first2, *__first1)) iterator __last1 = end();
{ iterator __first2 = __x.begin();
iterator __next = __first2; iterator __last2 = __x.end();
_M_transfer(__first1, __first2, ++__next); while (__first1 != __last1 && __first2 != __last2)
__first2 = __next; if (__comp(*__first2, *__first1))
} {
else iterator __next = __first2;
++__first1; _M_transfer(__first1, __first2, ++__next);
if (__first2 != __last2) _M_transfer(__last1, __first2, __last2); __first2 = __next;
}
else
++__first1;
if (__first2 != __last2)
_M_transfer(__last1, __first2, __last2);
}
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>