stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elemi...@apache.org
Subject svn commit: r668873 - in /stdcxx/branches/4.3.x: include/rw/_tuple.h tests/utilities/20.tuple.cnstr.cpp
Date Tue, 17 Jun 2008 23:23:40 GMT
Author: elemings
Date: Tue Jun 17 16:23:40 2008
New Revision: 668873

URL: http://svn.apache.org/viewvc?rev=668873&view=rev
Log:
2008-06-17  Eric Lemings <eric.lemings@roguewave.com>

	STDCXX-958
	* include/rw/_tuple.h: Implemented value move ctor.
	* tests/utilities/20.tuple.cnstr.cpp: Added value move ctor test
	cases.  (No copy ctors called in UserClass!)  Unknown problem
	with NestedTuple ctor.  Temporarily commented out.


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=668873&r1=668872&r2=668873&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_tuple.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_tuple.h Tue Jun 17 16:23:40 2008
@@ -206,7 +206,8 @@
           && !defined _RWSTD_NO_MEMBER_TEMPLATES
 
     template <class _HeadU, class... _TailU>
-    _EXPLICIT tuple (_HeadU&& __head, _TailU&&... __tail);
+    _EXPLICIT tuple (_HeadU&& __head, _TailU&&... __tail)
+        : _Base (__tail...), _C_head (__head) { /* empty */ }
 
     template <class _HeadU, class... _TailU>
     tuple (tuple<_HeadU, _TailU...>&& __tuple);

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=668873&r1=668872&r2=668873&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 16:23:40 2008
@@ -49,9 +49,12 @@
     UserClass::reset_totals ();
     UserTuple ut; _RWSTD_UNUSED (ut);
 
-    rw_assert (UserClass::n_total_def_ctor_ == 1, __FILE__, __LINE__,
+    rw_assert (1 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
                "tuple<UserClass>::tuple() called %d default ctors, "
                "expected 1", UserClass::n_total_def_ctor_);
+    rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
+               "tuple<UserClass>::tuple() called %d copy ctors, "
+               "expected 0", UserClass::n_total_def_ctor_);
 }
 
 /**************************************************************************/
@@ -77,6 +80,9 @@
     rw_assert (1 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
                "tuple<UserClass>::tuple() called %d default ctors, "
                "expected 1", UserClass::n_total_def_ctor_);
+    rw_assert (1 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
+               "tuple<UserClass>::tuple() called %d copy ctors, "
+               "expected 1", UserClass::n_total_def_ctor_);
 
     const bool b = true; const char c = 'a';
     const double d = 1.2; void* const p = 0;
@@ -90,6 +96,23 @@
 {
     rw_info (0, __FILE__, __LINE__, "value move constructor");
 
+    IntTuple it (1); //_RWSTD_UNUSED (it);
+    ConstIntTuple ct (1); _RWSTD_UNUSED (ct);
+    PairTuple pt (1L, "string"); _RWSTD_UNUSED (pt);
+    //NestedTuple nt (it); _RWSTD_UNUSED (nt);
+
+    BigTuple bt (true, 'a', 1, 1.0, (void*)0, UserClass ());
+    _RWSTD_UNUSED (bt);
+
+    UserClass::reset_totals ();
+    UserTuple ut (UserClass ()); _RWSTD_UNUSED (ut);
+
+    rw_assert (0 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
+               "tuple<UserClass>::tuple() called %d default ctors, "
+               "expected 0", UserClass::n_total_def_ctor_);
+    rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
+               "tuple<UserClass>::tuple() called %d copy ctors, "
+               "expected 0", UserClass::n_total_def_ctor_);
 }
 
 /**************************************************************************/
@@ -118,9 +141,12 @@
     const UserTuple ut1; UserTuple ut2 (ut1);
     _RWSTD_UNUSED (ut1);
 
-    rw_assert (UserClass::n_total_def_ctor_ == 1, __FILE__, __LINE__,
+    rw_assert (1 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
                "tuple<UserClass>::tuple() called %d default ctors, "
                "expected 1", UserClass::n_total_def_ctor_);
+    rw_assert (1 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
+               "tuple<UserClass>::tuple() called %d copy ctors, "
+               "expected 1", UserClass::n_total_def_ctor_);
 
     const BigTuple bt1; BigTuple bt2 (bt1);
     _RWSTD_UNUSED (bt1); _RWSTD_UNUSED (bt2);



Mime
View raw message