Author: elemings
Date: Tue Jun 17 15:55:32 2008
New Revision: 668865
URL: http://svn.apache.org/viewvc?rev=668865&view=rev
Log:
2008-06-17 Eric Lemings <[EMAIL PROTECTED]>
STDCXX-958
* include/rw/_tuple.h: Added tail accessors. Use tail accessors
in constructors and operators to properly construct base class
object.
* tests/utilities/20.tuple.cnstr.cpp: Uncomment BigTuple test
case that was failing to build because of this problem.
Modified:
stdcxx/branches/4.3.x/include/rw/_tuple.h
stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp
Modified: stdcxx/branches/4.3.x/include/rw/_tuple.h
URL:
http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_tuple.h?rev=668865&r1=668864&r2=668865&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_tuple.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_tuple.h Tue Jun 17 15:55:32 2008
@@ -97,7 +97,10 @@
protected:
- _HeadT _C_head;
+ _HeadT _C_head;
+
+ _Base& _C_tail () { return *this; }
+ const _Base& _C_tail () const { return *this; }
public:
@@ -112,7 +115,8 @@
* @param __tuple Another tuple value with same type.
*/
tuple (const tuple& __tuple)
- : _Base (__tuple), _C_head (__tuple._C_head) { /* empty */ }
+ : _Base (__tuple._C_tail ())
+ , _C_head (__tuple._C_head) { /* empty */ }
/**
* Copy assign tuple from a different tuple value.
@@ -121,7 +125,7 @@
* @return This tuple value.
*/
tuple& operator= (const tuple& __tuple) {
- _Base::operator= (__tuple);
+ _Base::operator= (__tuple._C_tail ());
_C_head = __tuple._C_head;
return *this;
}
@@ -147,7 +151,7 @@
* @param __tuple Some other homogenous tuple value.
*/
tuple (tuple&& __tuple)
- : _Base (std::forward<_Base> (__tuple))
+ : _Base (std::forward<_Base> (__tuple._C_tail ()))
, _C_head (_RWSTD_MOVE (__tuple._C_head)) { /* empty */ }
/**
@@ -158,7 +162,7 @@
* @returns Lvalue reference to this tuple value.
*/
tuple& operator= (tuple&& __tuple) {
- _Base::operator= (__tuple);
+ _Base::operator= (__tuple._C_tail ());
_C_head = _RWSTD_MOVE (__tuple._C_head);
return *this;
}
@@ -177,7 +181,8 @@
*/
template <class _HeadU, class... _TailU>
tuple (const tuple<_HeadU, _TailU...>& __tuple)
- : _Base (__tuple), _C_head (__tuple._C_head) { /* empty */ }
+ : _Base (__tuple._C_tail ())
+ , _C_head (__tuple._C_head) { /* empty */ }
/**
* Assign tuple by copying a heterogenous tuple value. This
@@ -190,7 +195,7 @@
*/
template <class _HeadU, class... _TailU>
tuple& operator= (const tuple<_HeadU, _TailU...>& __tuple) {
- _Base::operator= (__tuple);
+ _Base::operator= (__tuple._C_tail ());
_C_head = __tuple._C_head;
return *this;
}
Modified: stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp
URL:
http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp?rev=668865&r1=668864&r2=668865&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp Tue Jun 17
15:55:32 2008
@@ -122,8 +122,8 @@
"tuple<UserClass>::tuple() called %d default ctors, "
"expected 1", UserClass::n_total_def_ctor_);
- const BigTuple bt1; //BigTuple bt2 (bt1);
- _RWSTD_UNUSED (bt1); //_RWSTD_UNUSED (bt2);
+ const BigTuple bt1; BigTuple bt2 (bt1);
+ _RWSTD_UNUSED (bt1); _RWSTD_UNUSED (bt2);
}
/**************************************************************************/
@@ -146,11 +146,6 @@
//test_hetero_copy_assign ();
//test_hetero_move_assign ();
- //test_pair_copy_ctor ();
- //test_pair_move_ctor ();
- //test_pair_copy_assign ();
- //test_pair_move_assign ();
-
//test_alloc_ctors ();
return 0;