stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r510970 - in /incubator/stdcxx/trunk/tests: algorithms/ containers/ include/ numerics/ self/ src/ utilities/
Date Fri, 23 Feb 2007 14:57:47 GMT
Author: faridz
Date: Fri Feb 23 06:57:45 2007
New Revision: 510970

URL: http://svn.apache.org/viewvc?view=rev&rev=510970
Log:
2007-02-23 Farid Zaripov <faridz@kyiv.vdiweb.com>

	ChangeLog:
	* rw_value.h (struct UserData): new common structure holding
	value for UserPOD and UserClass types;
	(UserPOD): New user type to be used in tests as POD type
	* value.cpp: Use UserClass::data_.val_ instead of UserClass::val_;
	(__rw_from_char): new function to create array of the UserXXX type
	from string;
	(_rw_mismatch): new function compare the array of the UserXXX type
	and string.
	* 25.binary.search.cpp: Use UserClass::data_.val_ instead of UserClass::val_.
	* 25.copy.cpp: The same.
	* 25.equal.range.cpp: The same.
	* 25.fill.cpp: The same.
	* 25.find.cpp: The same.
	* 25.find.end.cpp: The same.
	* 25.for.each.cpp: The same.
	* 25.generate.cpp: The same.
	* 25.heap.cpp: The same.
	* 25.includes.cpp: The same.
	* 25.lex.comparison.cpp: The same.
	* 25.libc.cpp: The same.
	* 25.lower.bound.cpp: The same.
	* 25.merge.cpp: The same.
	* 25.min.max.cpp: The same.
	* 25.mismatch.cpp: The same.
	* 25.nth.element.cpp: The same.
	* 25.partial.sort.cpp: The same.
	* 25.partitions.cpp: The same.
	* 25.permutation.cpp: The same.
	* 25.random.shuffle.cpp: The same.
	* 25.remove.cpp: The same.
	* 25.replace.cpp: The same.
	* 25.reverse.cpp: The same.
	* 25.rotate.cpp: The same.
	* 25.search.cpp: The same.
	* 25.set.difference.cpp: The same.
	* 25.set.intersection.cpp: The same.
	* 25.set.sym.difference.cpp: The same.
	* 25.set.union.cpp: The same.
	* 25.sort.cpp: The same.
	* 25.swap.cpp: The same.
	* 25.transform.cpp: The same.
	* 25.upper.bound.cpp: The same.
	* 23.deque.modifiers.cpp: The same.
	* 23.vector.modifiers.cpp: The same.
	* 26.accumulate.cpp: The same.
	* 26.adjacent.diff.cpp: The same.
	* 26.inner.product.cpp: The same.
	* 26.partial.sum.cpp: The same.
	* 26.valarray.cons.cpp: The same.
	* 0.inputiter.cpp: The same.
	* 20.pairs.cpp: The same.

Modified:
    incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.find.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.merge.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.min.max.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.mismatch.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.partial.sort.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.partitions.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.permutation.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.remove.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.replace.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.reverse.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.rotate.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.search.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.set.difference.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.set.intersection.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.set.sym.difference.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.set.union.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.sort.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.swap.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.transform.cpp
    incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp
    incubator/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp
    incubator/stdcxx/trunk/tests/containers/23.vector.modifiers.cpp
    incubator/stdcxx/trunk/tests/include/rw_value.h
    incubator/stdcxx/trunk/tests/numerics/26.accumulate.cpp
    incubator/stdcxx/trunk/tests/numerics/26.adjacent.diff.cpp
    incubator/stdcxx/trunk/tests/numerics/26.inner.product.cpp
    incubator/stdcxx/trunk/tests/numerics/26.partial.sum.cpp
    incubator/stdcxx/trunk/tests/numerics/26.valarray.cons.cpp
    incubator/stdcxx/trunk/tests/self/0.inputiter.cpp
    incubator/stdcxx/trunk/tests/src/value.cpp
    incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp

Modified: incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.binary.search.cpp Fri Feb 23 06:57:45 2007
@@ -164,7 +164,7 @@
     // the type of the object is distinct from the iterator's value_type
     // to detect unwarranted assumptions made by the implementation
     Y value (0, 0 /* dummy arguments */);
-    value.xval_.val_ = val_char;
+    value.xval_.data_.val_ = val_char;
 
     // construct the Compare function object to pass to the algorithm
     // when `predicate' is true

Modified: incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.copy.cpp Fri Feb 23 06:57:45 2007
@@ -111,7 +111,7 @@
         // check that algjrithm works correctly
         std::size_t j = 0;
         for (; j != i + 1; ++j) {
-            success = src[j].val_ == dst[j].val_;
+            success = src[j].data_.val_ == dst[j].data_.val_;
             if (!success)
                 break;
         }
@@ -120,7 +120,7 @@
                    "%zu. copy(%p, %p, %p) mismatch at "
                    "offset %zu: expected %d, got %d: (%p, %p, %zu)",
                    i, src, src_end, dst,
-                   j, src[j].val_, dst[j].val_,
+                   j, src[j].data_.val_, dst[j].data_.val_,
                    dst, dst_end, j);
 
         if (!success)
@@ -200,7 +200,7 @@
         // verify 25.2.1, p5
         std::size_t j = 0;
         for (; j != i + 1; ++j) {
-            success = src[j].val_ == dst[j].val_;
+            success = src[j].data_.val_ == dst[j].data_.val_;
             if (!success)
                 break;
         }
@@ -209,7 +209,7 @@
                    "%zu. copy_backward(%p, %p, %p) mismatch at "
                    "offset %zu: expected %d, got %d: (%p, %p, %zu)",
                    i, src, src_end, dst_end,
-                   j, src[j].val_, dst[j].val_,
+                   j, src[j].data_.val_, dst[j].data_.val_,
                    dst, dst_end, j);
 
         if (!success)

Modified: incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.equal.range.cpp Fri Feb 23 06:57:45 2007
@@ -78,7 +78,7 @@
     // not Default-Constructible
     Y (char val, int /*dummy */): xval_ () {
         typedef unsigned char UChar;
-        xval_.val_ = int (UChar (val));
+        xval_.data_.val_ = int (UChar (val));
     }
 
     // CopyConstructible

Modified: incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.fill.cpp Fri Feb 23 06:57:45 2007
@@ -97,12 +97,13 @@
         // verify 25.2.5, p2
         std::size_t j = 0;
         for ( ; success && j != i; ++j) {
-            success = buf [j].val_ == value.val_;
+            success = buf [j].data_.val_ == value.data_.val_;
         }
 
         if (!rw_assert (success, 0, __LINE__, 
                         "%zu. fill (%s, %2$s, const %s&): buf [%zu]: %d != %d",
-                        i, itname, tname, j, buf [j].val_, value.val_))
+                        i, itname, tname, j, buf [j].data_.val_,
+                        value.data_.val_))
             break;
 
         // verify the complexity requirements:
@@ -161,12 +162,13 @@
         // verify 25.2.5, p2
         std::size_t j = 0;
         for ( ; success && j != i; ++j) {
-            success = buf [j].val_ == value.val_;
+            success = buf [j].data_.val_ == value.data_.val_;
         }
 
         rw_assert (success, 0, __LINE__, 
                    "%zu. fill_n (%s, %s, const %s&): buf [%zu]: %d != %d",
-                   i, itname, szname, tname, j, buf [j].val_, value.val_);
+                   i, itname, szname, tname, j, buf [j].data_.val_,
+                   value.data_.val_);
 
         if (!success)
             break;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.find.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.find.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.find.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.find.cpp Fri Feb 23 06:57:45 2007
@@ -138,7 +138,7 @@
     if (!rw_assert (res.cur_ == first.cur_ + findoff, 0, line,
                     "line %d: find%{?}_if%{;} (%s = \"%s\", ..., '%c')"
                     " == (it + %zu), got (it + %td)",
-                    __LINE__, test_pred, itname, src, to_find.val_,
+                    __LINE__, test_pred, itname, src, to_find.data_.val_,
                     findoff, res.cur_ - first.cur_)) {
         delete[] tsrc;
         return;
@@ -156,7 +156,7 @@
     rw_assert (npreds <= findoff + 1, 0, line,
                "line %d: find%{?}_if%{;} (%s = \"%s\", ..., '%c') "
                "invoked %s %zu times, expected no more than %zu",
-               __LINE__, test_pred, itname, src, to_find.val_,
+               __LINE__, test_pred, itname, src, to_find.data_.val_,
                pname, npreds, findoff + 1);
 
     delete[] tsrc;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.find.end.cpp Fri Feb 23 06:57:45 2007
@@ -145,7 +145,7 @@
     if (res.cur_ != last1.cur_) {
         std::size_t j = 0;
         for ( ; j < nfseq; ++j) {
-            success = (res.cur_ + j)->val_ == fseq[j];
+            success = (res.cur_ + j)->data_.val_ == fseq[j];
             if (!success)
                 break;
         }
@@ -154,7 +154,7 @@
                    "line %d: find_end<%s, %s>(it = \"%s\", \"%s\")"
                    " expected value %c got %c at %zu position",
                    __LINE__, it1name, it2name, src, fseq,
-                   fseq[j], (res.cur_ + j)->val_, j);
+                   fseq[j], (res.cur_ + j)->data_.val_, j);
 
         if (!success) {
             delete[] tsrc;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp Fri Feb 23 06:57:45 2007
@@ -63,7 +63,7 @@
 
     void operator() (UserClass val)  /* not const */ {
         ++funcalls_;
-        sum_ += val.val_;
+        sum_ += val.data_.val_;
     }
 
     static const char* name () { return "ConstFunction"; }
@@ -78,7 +78,7 @@
 
     void operator() (UserClass &val) /* not const */ {
         ++funcalls_;
-        val.val_ = -val.val_;
+        val.data_.val_ = -val.data_.val_;
     }
 
     static const char* name () { return "MutableFunction"; }
@@ -99,7 +99,7 @@
 
     UserClass *buf = new UserClass [N];
 
-    const int first_val = buf [0].val_;
+    const int first_val = buf [0].data_.val_;
 
     for (std::size_t i = 0; i != N; ++i) {
 
@@ -133,21 +133,21 @@
             }
 
             // compute the sum (computed by the const function object)
-            sum += buf [j].val_;
+            sum += buf [j].data_.val_;
 
             // assert the element value as the same as the expected value
-            rw_assert (expect == buf [j].val_, 0, __LINE__,
+            rw_assert (expect == buf [j].data_.val_, 0, __LINE__,
                        "for_each (%s, %1$s, %s); element [%zu] == %d, got %d",
-                       itname, fnname, j, expect, buf [j].val_);
+                       itname, fnname, j, expect, buf [j].data_.val_);
 
-            if (expect != buf [j].val_) {
+            if (expect != buf [j].data_.val_) {
                 // break out of both loops on failure
                 i = N;
                 break;
             }
 
             // restore the original value of the element
-            buf [j].val_ = first_val + int (j);
+            buf [j].data_.val_ = first_val + int (j);
         }
 
         // assert that for_each invoked the function object's operator()

Modified: incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.generate.cpp Fri Feb 23 06:57:45 2007
@@ -122,7 +122,7 @@
         const Generator<T> gen (0, 0);
 
         // store the value of the next element
-        const int last_val = Generator<T>(0, 0)().val_;
+        const int last_val = Generator<T>(0, 0)().data_.val_;
 
         std::generate (begin, end, gen);
 
@@ -131,14 +131,14 @@
         // verify 25.2.6, p2
         std::size_t j = 0;
         for ( ; j != i; ++j) {
-            success = (begin.cur_ + j)->val_ == int (last_val + j + 1);
+            success = (begin.cur_ + j)->data_.val_ == int (last_val + j + 1);
             if (!success)
                 break;
         }
 
         rw_assert (success, 0, __LINE__, 
                    "%zu. generate (): buf[%zu]: %d != %d",
-                   i + 1, j, last_val + j + 1, (begin.cur_ + j)->val_ );
+                   i + 1, j, last_val + j + 1, (begin.cur_ + j)->data_.val_ );
 
         if (!success)
             break;
@@ -190,7 +190,7 @@
         const Generator<T> gen (0, 0);
 
         // store the value of the next element
-        const int last_val = Generator<T>(0, 0)().val_;
+        const int last_val = Generator<T>(0, 0)().data_.val_;
 
         std::generate_n (begin, n, gen);
 
@@ -199,14 +199,14 @@
         // verify 25.2.6, p2
         std::size_t j = 0;
         for ( ; j != i; ++j) {
-            success = (begin.cur_ + j)->val_ == int (last_val + j + 1);
+            success = (begin.cur_ + j)->data_.val_ == int (last_val + j + 1);
             if (!success)
                 break;
         }
 
         rw_assert (success, 0, __LINE__, 
                    "%zu. generate_n (): buf[%zu]: %d != %d",
-                   i + 1, j, last_val + j + 1, (begin.cur_ + j)->val_ );
+                   i + 1, j, last_val + j + 1, (begin.cur_ + j)->data_.val_ );
 
         if (!success)
             break;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.heap.cpp Fri Feb 23 06:57:45 2007
@@ -113,7 +113,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }
@@ -133,7 +133,7 @@
   std::size_t parent = 0;
   for (std::size_t child = 1; child < len; ++child) {
 
-      if (seq [parent].val_ < seq [child].val_) 
+      if (seq [parent].data_.val_ < seq [child].data_.val_) 
           return false;
 
       if ((child & 1) == 0)
@@ -169,7 +169,7 @@
     T* const xsrc     = T::from_char (src, nsrc);
     T* const xsrc_end = xsrc + nsrc;
 
-    int val = xsrc[0].val_;
+    int val = xsrc[0].data_.val_;
 
     const RandIter first = make_iter (xsrc,     xsrc, xsrc_end, rand_iter);
     const RandIter last  = make_iter (xsrc_end, xsrc, xsrc_end, rand_iter);
@@ -200,11 +200,11 @@
     if (2 == finx) {     // pop_heap special verification
         // verify that the maximal element is in 
         // the end of the sequence: 25.3.6.2, p2
-        rw_assert (val == xsrc[nsrc - 1].val_, 0, line,
+        rw_assert (val == xsrc[nsrc - 1].data_.val_, 0, line,
                    "line %d std::%s <%s%{?}, %s%{;}> (\"%s\", ...) ==> "
                    "\"%{X=*.*}\", last is %#c, expected %#c",
                    __LINE__, fname, itname, ppred, funname, src, 
-                   int (nsrc), -1, xsrc, xsrc [nsrc - 1].val_, val);
+                   int (nsrc), -1, xsrc, xsrc [nsrc - 1].data_.val_, val);
     }
 
     if (3 == finx) {     // sort_heap special verification

Modified: incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.includes.cpp Fri Feb 23 06:57:45 2007
@@ -75,7 +75,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.lex.comparison.cpp Fri Feb 23 06:57:45 2007
@@ -75,7 +75,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.libc.cpp Fri Feb 23 06:57:45 2007
@@ -62,8 +62,8 @@
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
-        return   (*_RWSTD_STATIC_CAST (const UserClass*, x)).val_
-               - (*_RWSTD_STATIC_CAST (const UserClass*, y)).val_;
+        return   (*_RWSTD_STATIC_CAST (const UserClass*, x)).data_.val_
+               - (*_RWSTD_STATIC_CAST (const UserClass*, y)).data_.val_;
     }
 }
 
@@ -79,8 +79,8 @@
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
-        return   (*_RWSTD_STATIC_CAST (const UserClass*, x)).val_
-               - (*_RWSTD_STATIC_CAST (const UserClass*, y)).val_;
+        return   (*_RWSTD_STATIC_CAST (const UserClass*, x)).data_.val_
+               - (*_RWSTD_STATIC_CAST (const UserClass*, y)).data_.val_;
     }
 }
 
@@ -179,7 +179,7 @@
     RW_ASSERT (0 == nsrc || 0 != xsrc);
 
     UserClass key;
-    key.val_ = key_val;
+    key.data_.val_ = key_val;
 
     const void* result = cxx ?
         std::bsearch (&key, xsrc, nsrc, sizeof *xsrc, cxx_comp)

Modified: incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.lower.bound.cpp Fri Feb 23 06:57:45 2007
@@ -119,7 +119,7 @@
     // the type of the object is distinct from the iterator's value_type
     // to detect unwarranted assumptions made by the implementation
     Y value (0, 0 /* dummy arguments */);
-    value.xval_.val_ = val_char;
+    value.xval_.data_.val_ = val_char;
 
     // construct the Compare function object to pass to the algorithm
     // when `predicate' is true

Modified: incubator/stdcxx/trunk/tests/algorithms/25.merge.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.merge.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.merge.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.merge.cpp Fri Feb 23 06:57:45 2007
@@ -90,7 +90,7 @@
     conv_to_bool operator() (const UserClass &x,
                              const UserClass &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
 private:
@@ -258,7 +258,7 @@
     // check that the algorithm is stable
     std::size_t i = 1;
     for ( ; i < ndst; i++) {
-        if (xdst [i - 1].val_ == xdst [i].val_) {
+        if (xdst [i - 1].data_.val_ == xdst [i].data_.val_) {
             success = xdst [i - 1].origin_ < xdst [i].origin_;
             if (!success)
                 break;
@@ -275,7 +275,7 @@
                __LINE__, algname, it1name, !inplace, it2name, outname, 
                predicate, predname, src1, !inplace, src2, inplace, midinx,
                int (ndst), i, xdst, i, xdst [i - 1].origin_, 
-               xdst [i].origin_, xdst [i - 1].val_, xdst [i].val_);
+               xdst [i].origin_, xdst [i - 1].data_.val_, xdst [i].data_.val_);
 
     // check the complexity
     success = n_ops_lt <= ndst - 1;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.min.max.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.min.max.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.min.max.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.min.max.cpp Fri Feb 23 06:57:45 2007
@@ -106,7 +106,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }
@@ -133,8 +133,8 @@
     const char* const funname = Predicate::name();
 
     T ta, tb;
-    ta.val_ = a;
-    tb.val_ = b;
+    ta.data_.val_ = a;
+    tb.data_.val_ = b;
 
     const int exp_id =
         test_min ? b < a ? tb.id_ : ta.id_ : b > a ? tb.id_ : ta.id_;
@@ -148,11 +148,11 @@
       : test_min ? std::min (ta, tb) : std::max (ta, tb);
 
     // verify 25.3.7 p2, p3, p5, p6
-    rw_assert (exp_res == res.val_ && exp_id == res.origin_, 0, line,
+    rw_assert (exp_res == res.data_.val_ && exp_id == res.origin_, 0, line,
                "line %d %s <%s%{?}, %s%{;}> (%#c, %#c) returned "
                "value %#c, id %d; expected value %#c, id %d",
                __LINE__, fname, tname, 0 != ppred, funname, a, b,
-               res.val_, res.origin_, exp_res, exp_id);
+               res.data_.val_, res.origin_, exp_res, exp_id);
 }
 
 /**************************************************************************/

Modified: incubator/stdcxx/trunk/tests/algorithms/25.mismatch.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.mismatch.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.mismatch.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.mismatch.cpp Fri Feb 23 06:57:45 2007
@@ -120,16 +120,16 @@
 
         // iterators are valid check that the algorithm works correctly
         success = 
-               res_buf1_end->val_ == expected_buf1_end->val_
-            && res_buf2_end->val_ == expected_buf2_end->val_;
+               res_buf1_end->data_.val_ == expected_buf1_end->data_.val_
+            && res_buf2_end->data_.val_ == expected_buf2_end->data_.val_;
 
         rw_assert (success, 0, __LINE__, 
                    "%zu. mismatch (%s, %2$s, %s%{?}, %s%{;}): "
                    "correctness: got: %d "
                    "expected: %d, got: %d expected: %d",
                    i, it1name, it2name, 0 != predicate, predicate,
-                   res_buf1_end->val_, expected_buf1_end->val_,
-                   res_buf2_end->val_, expected_buf2_end->val_);
+                   res_buf1_end->data_.val_, expected_buf1_end->data_.val_,
+                   res_buf2_end->data_.val_, expected_buf2_end->data_.val_);
 
         // verify 25.1.7, p3
         success = UserClass::n_total_op_eq_ - last_n_op_eq <= (N + 1);

Modified: incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.nth.element.cpp Fri Feb 23 06:57:45 2007
@@ -73,7 +73,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "StrictWeakLess"; }
@@ -134,7 +134,7 @@
 
     for (i = 0; i < nth; i++) {
         for (j = nth; j < nsrc; j++) {
-            success = xsrc[i].val_ <= xsrc[j].val_;
+            success = xsrc[i].data_.val_ <= xsrc[j].data_.val_;
             if (!success)
                 break;
         }
@@ -152,14 +152,15 @@
                    "line %d: %s<%s%{?}, %s%{;}>(\"%s\", %zu, ...) ==> "
                    "\"%{X=*.*}\", got %#c at %zu !< %#c at %zu",
                    __LINE__, fname, itname, ppred, funname, src, nth, 
-                   int (nsrc), -1, xsrc, xsrc[i].val_, i, xsrc[j].val_, j);
+                   int (nsrc), -1, xsrc, xsrc[i].data_.val_, i,
+                   xsrc[j].data_.val_, j);
     }
     else {
         rw_assert (success, 0, line,
                    "line %d: %s<%s%{?}, %s%{;}>(%zu, %zu, ...) "
                    "got %d at %zu !< %d at %zu",
                    __LINE__, fname, itname, ppred, funname, N, nth, 
-                   xsrc[i].val_, i, xsrc[j].val_, j);
+                   xsrc[i].data_.val_, i, xsrc[j].data_.val_, j);
     }
 
     // check the complexity, 25.3.2, p2

Modified: incubator/stdcxx/trunk/tests/algorithms/25.partial.sort.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.partial.sort.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.partial.sort.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.partial.sort.cpp Fri Feb 23 06:57:45 2007
@@ -90,7 +90,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }
@@ -196,22 +196,22 @@
 
     // check that any element in the sorted range <= that any element 
     // in the rest part of the array
-    int max_el = res_x[0].val_;
+    int max_el = res_x[0].data_.val_;
     std::size_t j = 1;
     for ( ; j < mid; j++)
-        max_el = max_el < res_x[j].val_ ? res_x[j].val_ : max_el;
+        max_el = max_el < res_x[j].data_.val_ ? res_x[j].data_.val_ : max_el;
 
     if (copy) {
         std::size_t tmp = 0;
         for (j = 0; j < nsrc; j++) 
-            if (max_el > xsrc[j].val_) 
+            if (max_el > xsrc[j].data_.val_) 
                 tmp++;
 
         success = tmp <= mid;
     }
     else {
         for (j = mid; j < nsrc; j++) {
-            success = max_el <= xsrc[j].val_;
+            success = max_el <= xsrc[j].data_.val_;
             if (! success)
                 break;
         }
@@ -227,7 +227,7 @@
                    "%{?}%#c%{;} in the unsorted part",
                    __LINE__, fname, itname, copy, outname, ppred, funname, 
                    src, mid, int (copy ? mid : nsrc), -1, res_x, 
-                   !copy, xsrc[j].val_);
+                   !copy, xsrc[j].data_.val_);
     }
     else {
         rw_assert (success, 0, line,

Modified: incubator/stdcxx/trunk/tests/algorithms/25.partitions.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.partitions.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.partitions.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.partitions.cpp Fri Feb 23 06:57:45 2007
@@ -74,7 +74,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &arg) {
         ++funcalls_;
-        return conv_to_bool::make (value_ < arg.val_);
+        return conv_to_bool::make (value_ < arg.data_.val_);
     }
 
     static const char* name () { return "GreaterThanPredicate"; }
@@ -150,7 +150,7 @@
     // "left" part of the array there the predicate should be true
     std::size_t i = 0;
     for ( ; i < offset; i++) {
-        success = xsrc[i].val_ > value;
+        success = xsrc[i].data_.val_ > value;
         if (!success)
             break;
     }
@@ -159,12 +159,12 @@
                "line %d: std::%s <%s, %s>(\"%s\", ...) "
                "==> \"%{X=*.*}\", at %zu got: %#c !> %#c",
                __LINE__, fname, itname, funname, src, int (nsrc), 
-               -1, xsrc, i + 1, xsrc[i].val_, value);
+               -1, xsrc, i + 1, xsrc[i].data_.val_, value);
 
 
     // "right" part of the array there the predicate should be false
     for ( ; i < nsrc; i++) {
-        success = xsrc[i].val_ <= value;
+        success = xsrc[i].data_.val_ <= value;
         if (!success)
             break;
     }
@@ -173,7 +173,7 @@
                "line %d: std::%s <%s, %s>(\"%s\", ...) "
                "==> \"%{X=*.*}\", at %zu got: %#c !<= %#c",
                __LINE__, fname, itname, funname, src, int (nsrc), 
-               -1, xsrc, i + 1, xsrc[i].val_, value);
+               -1, xsrc, i + 1, xsrc[i].data_.val_, value);
 
 
     // check the complexity, 25.2.12 p3 & p6
@@ -207,7 +207,7 @@
 
         // check the stable_partition is really stable 25.2.12, p5
         for (i = 0; i < nsrc; i++) {
-            success = xsrc[i].val_ == xdst[i].val_;
+            success = xsrc[i].data_.val_ == xdst[i].data_.val_;
             if (!success)
                 break;
         }
@@ -218,7 +218,7 @@
                    "%#c != %#c",
                    __LINE__, fname, itname, funname, src, 
                    int (nsrc), int (i), xsrc, int (ndst), int (i), xdst,
-                   i, xsrc[i].val_, xdst[i].val_);
+                   i, xsrc[i].data_.val_, xdst[i].data_.val_);
     }
 
     delete[] xsrc;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.permutation.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.permutation.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.permutation.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.permutation.cpp Fri Feb 23 06:57:45 2007
@@ -83,7 +83,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }
@@ -148,7 +148,7 @@
     // verify the permutation result
     std::size_t i = 0;
     for ( ; i < nsrc; i++) {
-        success = xsrc [i].val_ == dst [i];
+        success = xsrc [i].data_.val_ == dst [i];
         if (!success)
             break;
     }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp Fri Feb 23 06:57:45 2007
@@ -215,7 +215,7 @@
         std::size_t j;
         std::memset (missing, 1, N);
         for (j = 0; j != i; ++j) {
-            const std::size_t inx = std::size_t (buf [j].val_);
+            const std::size_t inx = std::size_t (buf [j].data_.val_);
             if (inx < N)
                 missing [inx] = 0;
         }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.remove.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.remove.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.remove.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.remove.cpp Fri Feb 23 06:57:45 2007
@@ -154,7 +154,7 @@
 
     // construct an element to remove
     T to_remove;
-    to_remove.val_ = val;
+    to_remove.data_.val_ = val;
 
     // construct a predicate object (used with remove_if() only)
     const Predicate pred (to_remove, 0);
@@ -190,7 +190,7 @@
     // anywhere in the range [first, end) : p 25.2.7.2
     std::size_t i = 0;
     for ( ; i != nsrc - nrem; ++i) {
-        success = UChar (val) != xsrc [i].val_;
+        success = UChar (val) != xsrc [i].data_.val_;
         if (!success)
             break;
     }
@@ -221,7 +221,7 @@
     // are unchanged 
     success = true;
     for (i = nsrc - nrem; i != nsrc; ++i) {
-        success = src [i] == xsrc [i].val_;
+        success = src [i] == xsrc [i].data_.val_;
         if (!success)
             break;
     }
@@ -270,7 +270,7 @@
     T* const xdst = T::from_char (src, nsrc);
 
     T to_remove;
-    to_remove.val_ = val;
+    to_remove.data_.val_ = val;
 
     const Predicate pred (to_remove, 0);
 
@@ -299,7 +299,7 @@
     // in the range [result, end)
     std::size_t i = 0;
     for ( ; i != nsrc - nrem; ++i) {
-        success = UChar (val) != xdst [i].val_;
+        success = UChar (val) != xdst [i].data_.val_;
         if (!success)
             break;
     }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.replace.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.replace.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.replace.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.replace.cpp Fri Feb 23 06:57:45 2007
@@ -163,11 +163,11 @@
 
     // construct an element to replace
     T to_replace;
-    to_replace.val_ = val;
+    to_replace.data_.val_ = val;
 
     // construct an element to replace it with
     T replace_with;
-    replace_with.val_ = new_val;
+    replace_with.data_.val_ = new_val;
 
     // construct a predicate object (used with replace_if() only)
     const Predicate pred (to_replace, 0);
@@ -191,7 +191,7 @@
     bool success = true;
     std::size_t i = 0;
     for ( ; i != nsrc; ++i) {
-        success = to_replace.val_ != xsrc [i].val_;
+        success = to_replace.data_.val_ != xsrc [i].data_.val_;
         if (!success)
             break;
     }
@@ -274,10 +274,10 @@
     T* const xdst_end = xdst + nsrc;
 
     T to_replace;
-    to_replace.val_ = val;
+    to_replace.data_.val_ = val;
 
     T replace_with;
-    replace_with.val_ = new_val;
+    replace_with.data_.val_ = new_val;
 
     const Predicate pred (to_replace, 0);
 
@@ -304,7 +304,7 @@
     std::size_t i = 0;
     for ( ; i != nsrc; ++i) {
         typedef unsigned char UChar;
-        success = UChar (val) != xdst [i].val_;
+        success = UChar (val) != xdst [i].data_.val_;
         if (!success)
             break;
     }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.reverse.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.reverse.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.reverse.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.reverse.cpp Fri Feb 23 06:57:45 2007
@@ -87,10 +87,10 @@
 {
     ++iter_swap_calls;
 
-    const int tmp = (*i).val_;
+    const int tmp = (*i).data_.val_;
 
-    (*i).val_ = (*j).val_;
-    (*j).val_ = tmp;
+    (*i).data_.val_ = (*j).data_.val_;
+    (*j).data_.val_ = tmp;
 }
 
 _RWSTD_SPECIALIZED_FUNCTION
@@ -98,10 +98,10 @@
 {
     ++iter_swap_calls;
 
-    const int tmp = (*i).val_;
+    const int tmp = (*i).data_.val_;
 
-    (*i).val_ = (*j).val_;
-    (*j).val_ = tmp;
+    (*i).data_.val_ = (*j).data_.val_;
+    (*j).data_.val_ = tmp;
 }
 
 }   // namespace std
@@ -144,7 +144,7 @@
 
         typedef unsigned char UChar;
 
-        success = UChar (src [i]) == xsrc [nsrc - i - 1].val_;
+        success = UChar (src [i]) == xsrc [nsrc - i - 1].data_.val_;
         if (!success)
             break;
     }
@@ -154,7 +154,7 @@
                "\"%{X=*.*}\"; unexpected element value %#c at offset %zu",
                __LINE__, fname, itname, src,
                int (nsrc), int (i), xsrc,
-               xsrc [nsrc - i - 1].val_, i);
+               xsrc [nsrc - i - 1].data_.val_, i);
 
     const std::size_t iter_swap_expect = nsrc / 2;
     success = iter_swap_calls == iter_swap_expect;
@@ -205,7 +205,7 @@
 
         typedef unsigned char UChar;
 
-        success = UChar (src [i]) == xdst [nsrc - i - 1].val_;
+        success = UChar (src [i]) == xdst [nsrc - i - 1].data_.val_;
         if (!success)
             break;
     }
@@ -215,7 +215,7 @@
                "\"%{X=*.*}\"; unexpected element value %#c at offset %zu",
                __LINE__, fname, itname, src,
                int (nsrc), int (i), xsrc,
-               xdst [nsrc - i - 1].val_, i);
+               xdst [nsrc - i - 1].data_.val_, i);
 
     success = T::n_total_op_assign_ - last_n_op_assign == nsrc;
     rw_assert (success, 0, line,

Modified: incubator/stdcxx/trunk/tests/algorithms/25.rotate.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.rotate.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.rotate.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.rotate.cpp Fri Feb 23 06:57:45 2007
@@ -90,10 +90,10 @@
 {
     ++iter_swap_calls;
 
-    const int tmp = (*i).val_;
+    const int tmp = (*i).data_.val_;
 
-    (*i).val_ = (*j).val_;
-    (*j).val_ = tmp;
+    (*i).data_.val_ = (*j).data_.val_;
+    (*j).data_.val_ = tmp;
 }
 
 
@@ -102,10 +102,10 @@
 {
     ++iter_swap_calls;
 
-    const int tmp = (*i).val_;
+    const int tmp = (*i).data_.val_;
 
-    (*i).val_ = (*j).val_;
-    (*j).val_ = tmp;
+    (*i).data_.val_ = (*j).data_.val_;
+    (*j).data_.val_ = tmp;
 }
 
 
@@ -114,10 +114,10 @@
 {
     ++iter_swap_calls;
 
-    const int tmp = (*i).val_;
+    const int tmp = (*i).data_.val_;
 
-    (*i).val_ = (*j).val_;
-    (*j).val_ = tmp;
+    (*i).data_.val_ = (*j).data_.val_;
+    (*j).data_.val_ = tmp;
 }
 
 }   // namespace std
@@ -164,7 +164,7 @@
 
         typedef unsigned char UChar;
 
-        success = UChar (src [i]) == xsrc [xpos].val_;
+        success = UChar (src [i]) == xsrc [xpos].data_.val_;
         if (!success)
             break;
     }
@@ -173,7 +173,7 @@
                "line %d: %s<%s>(\"%s\", %zu, ...) ==> "
                "\"%{X=*.*}\"; unexpected element value %#c at %zu",
                __LINE__, fname, itname, src, midnsrc,
-               int (nsrc), int (i), xsrc, xsrc [xpos].val_, i);
+               int (nsrc), int (i), xsrc, xsrc [xpos].data_.val_, i);
 
     success = iter_swap_calls <= nsrc;
     rw_assert (success, 0, line,
@@ -230,7 +230,7 @@
 
         typedef unsigned char UChar;
 
-        success = UChar (src [i]) == xdst [xpos].val_;
+        success = UChar (src [i]) == xdst [xpos].data_.val_;
         if (!success)
             break;
     }
@@ -239,7 +239,7 @@
                "line %d: %s<%s, %s>(\"%s\", %zu, ...) ==> "
                "\"%{X=*.*}\"; unexpected element value %#c at %zu",
                __LINE__, fname, it1name, it2name, src, midnsrc,
-               int (nsrc), int (i), xsrc, xdst [xpos].val_, i);
+               int (nsrc), int (i), xsrc, xdst [xpos].data_.val_, i);
 
     success = T::n_total_op_assign_ - last_n_op_assign == nsrc;
     rw_assert (success, 0, line,

Modified: incubator/stdcxx/trunk/tests/algorithms/25.search.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.search.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.search.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.search.cpp Fri Feb 23 06:57:45 2007
@@ -408,7 +408,7 @@
     _RWSTD_UNUSED (expected);
 
     T value;
-    value.val_ = val;
+    value.data_.val_ = val;
 
     T::n_total_op_eq_ = 0;
     PredTag::Predicate::funcalls_ = 0;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.set.difference.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.set.difference.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.set.difference.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.set.difference.cpp Fri Feb 23 06:57:45 2007
@@ -79,7 +79,7 @@
     conv_to_bool operator() (const UserClass &x,
                              const UserClass &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
 private:
@@ -208,7 +208,7 @@
     std::size_t n2 = 0;
     for ( ; i < ndst; ++i) {
         xdst[i].origin_ <= max1_id ? n1++ : n2++;
-        success = xdst[i].val_ == res[i];
+        success = xdst[i].data_.val_ == res[i];
         if (!success)
             break;
     }
@@ -248,8 +248,9 @@
                    " ==> \"%{X=*.*}\" not stable : elements %#c==%#c have "
                    "ids %d >= %d ",
                    __LINE__, fname, it1name, it2name, outname, predicate, 
-                   funname, src1, src2, int (ndst), i, xdst, xdst[i - 1].val_, 
-                   xdst[i].val_, xdst[i - 1].origin_, xdst[i].origin_);
+                   funname, src1, src2, int (ndst), i, xdst,
+                   xdst[i - 1].data_.val_, xdst[i].data_.val_,
+                   xdst[i - 1].origin_, xdst[i].origin_);
     }
 
     // verify the complexity

Modified: incubator/stdcxx/trunk/tests/algorithms/25.set.intersection.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.set.intersection.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.set.intersection.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.set.intersection.cpp Fri Feb 23 06:57:45 2007
@@ -79,7 +79,7 @@
     conv_to_bool operator() (const UserClass &x,
                              const UserClass &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
 private:
@@ -208,7 +208,7 @@
     std::size_t n2 = 0;
     for ( ; i < ndst; i++) {
         xdst[i].origin_ <= max1_id ? n1++ : n2++;
-        success = xdst[i].val_ == res[i];
+        success = xdst[i].data_.val_ == res[i];
         if (!success)
             break;
     }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.set.sym.difference.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.set.sym.difference.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.set.sym.difference.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.set.sym.difference.cpp Fri Feb 23 06:57:45 2007
@@ -79,7 +79,7 @@
     conv_to_bool operator() (const UserClass &x,
                              const UserClass &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
 private:
@@ -211,7 +211,7 @@
     std::size_t n2 = 0;
     for ( ; i < ndst; i++) {
         xdst [i].origin_ <= max1_id ? n1++ : n2++;
-        success = xdst [i].val_ == res [i];
+        success = xdst [i].data_.val_ == res [i];
         if (!success)
             break;
     }
@@ -238,7 +238,7 @@
     // verify that the operation is stable: two equal elements
     // should go in the same order
     for (i = 1; i < ndst; i++) {
-        if (xdst [i - 1].val_ == xdst [i].val_) {
+        if (xdst [i - 1].data_.val_ == xdst [i].data_.val_) {
             success = xdst [i - 1].origin_ < xdst [i].origin_;
             if (!success)
                 break;
@@ -254,8 +254,9 @@
                    " ==> \"%{X=*.*}\" not stable : elements %#c==%#c have "
                    "ids %d >= %d ",
                    __LINE__, algname, it1name, it2name, outname, predicate, 
-                   funname, src1, src2, int (ndst), i, xdst, xdst[i - 1].val_, 
-                   xdst[i].val_, xdst[i - 1].origin_, xdst[i].origin_);
+                   funname, src1, src2, int (ndst), i, xdst,
+                   xdst[i - 1].data_.val_, xdst[i].data_.val_,
+                   xdst[i - 1].origin_, xdst[i].origin_);
     }
 
     // verify the complexity

Modified: incubator/stdcxx/trunk/tests/algorithms/25.set.union.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.set.union.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.set.union.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.set.union.cpp Fri Feb 23 06:57:45 2007
@@ -77,7 +77,7 @@
     conv_to_bool operator() (const UserClass &x,
                              const UserClass &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
 private:
@@ -204,7 +204,7 @@
     std::size_t n2 = 0;
     for ( ; i < ndst; i++) {
         xdst[i].origin_ <= max1_id ? n1++ : n2++;
-        success = xdst[i].val_ == res[i];
+        success = xdst[i].data_.val_ == res[i];
         if (!success)
             break;
     }

Modified: incubator/stdcxx/trunk/tests/algorithms/25.sort.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.sort.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.sort.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.sort.cpp Fri Feb 23 06:57:45 2007
@@ -85,7 +85,7 @@
     // convertible to bool to detect incorrect assumptions
     conv_to_bool operator() (const T &x, const T &y) /* non-const */ {
         ++funcalls_;
-        return conv_to_bool::make (x.val_ < y.val_);
+        return conv_to_bool::make (x.data_.val_ < y.data_.val_);
     }
 
     static const char* name () { return "Less"; }
@@ -232,7 +232,7 @@
     if (stable) {
         std::size_t j = 1;
         for ( ; j < N; j++) {
-            if (xsrc[j - 1].val_ == xsrc[j].val_)
+            if (xsrc[j - 1].data_.val_ == xsrc[j].data_.val_)
                 success = xsrc[j - 1].origin_ < xsrc[j].origin_;
 
             if (!success)
@@ -249,7 +249,8 @@
                        "got ids %zu and %zu for values %#c and %#c",
                        __LINE__, fname, itname, ppred, funname, src,
                        int (nsrc), -1, xsrc, j, xsrc[j - 1].origin_, 
-                       xsrc[j].origin_, xsrc[j - 1].val_, xsrc[j].val_);
+                       xsrc[j].origin_, xsrc[j - 1].data_.val_,
+                       xsrc[j].data_.val_);
         }
         else {
             rw_assert (success, 0, line,
@@ -258,7 +259,7 @@
                        "for values %d and %d",
                        __LINE__, fname, itname, ppred, funname, 
                        nsrc, j, xsrc[j - 1].origin_, xsrc[j].origin_,
-                       xsrc[j - 1].val_, xsrc[j].val_);
+                       xsrc[j - 1].data_.val_, xsrc[j].data_.val_);
         }
     }
 

Modified: incubator/stdcxx/trunk/tests/algorithms/25.swap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.swap.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.swap.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.swap.cpp Fri Feb 23 06:57:45 2007
@@ -89,13 +89,13 @@
         const ForwardIterator2 it2 = 
             make_iter (tseq + i, tseq, tseq + nseq, it2);
 
-        a_val = (*it1).val_;
-        b_val = (*it2).val_;
+        a_val = (*it1).data_.val_;
+        b_val = (*it2).data_.val_;
 
         it_swap ? std::iter_swap (it1, it2) : std::swap(*it1, *it2);
 
         // verify 25.2.2, p2, p7
-        success = a_val == (*it2).val_ && b_val == (*it1).val_;
+        success = a_val == (*it2).data_.val_ && b_val == (*it1).data_.val_;
         if (!success)
             break;
     }
@@ -103,8 +103,8 @@
     rw_assert (success, 0, line,
                "%s<%s%{?}, %s%{;}>(%#c, %#c): got: { %#c, %#c } "
                "expected: { %5$#c, %4$#c } at step %zu",
-               fname, it1name, it_swap, it2name, a_val, b_val, tseq->val_, 
-               (tseq + i)->val_, i);
+               fname, it1name, it_swap, it2name, a_val, b_val,
+               tseq->data_.val_, (tseq + i)->data_.val_, i);
 
     delete[] tseq;
 }
@@ -195,7 +195,8 @@
     // check that the sequences were swapped, 25.2.2 p4
     std::size_t i = 0;
     for ( ; i < nseq; ++i) {
-        success = (tseq1 + i)->val_ == seq2[i] && (tseq2 + i)->val_ == seq1[i];
+        success =    (tseq1 + i)->data_.val_ == seq2[i]
+                  && (tseq2 + i)->data_.val_ == seq1[i];
         if (!success)
             break;
     }
@@ -203,8 +204,8 @@
     rw_assert (success, 0, line, 
                "swap_ranges<%s, %s>(\"%s\", \"%s\") mismatch at pos %zu "
                "got { %#c, %#c }, expected { %#c, %#c }",
-               it1name, it2name, seq1, seq2, i,
-               (tseq1 + i)->val_, (tseq2 + i)->val_, seq2[i], seq1[i]);
+               it1name, it2name, seq1, seq2, i, (tseq1 + i)->data_.val_,
+               (tseq2 + i)->data_.val_, seq2[i], seq1[i]);
 
     // check the complexity, 25.2.2 p6
     std::size_t swaps_per_swap_ranges =

Modified: incubator/stdcxx/trunk/tests/algorithms/25.transform.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.transform.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.transform.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.transform.cpp Fri Feb 23 06:57:45 2007
@@ -81,7 +81,7 @@
     T operator() (const T &x) /* non-const */ {
         ++funcalls_;
         T y (x);
-        y.val_ += 1;
+        y.data_.val_ += 1;
         return y;
     }
 
@@ -109,7 +109,7 @@
     T operator() (const T &a, const T &b) /* non-const */ {
         ++funcalls_;
         T x (a);
-        x.val_ = a.val_ + b.val_;
+        x.data_.val_ = a.data_.val_ + b.data_.val_;
         return x;
     }
 
@@ -182,8 +182,10 @@
     T* const buf2 = new T [nloops + 1];
     T* const buf3 = same_seq ? (same_seq == 1 ? buf1 : buf2) : new T [nloops];
 
-    const int start1_val = same_seq == 2 ? buf2 [0].val_ : buf1 [0].val_;
-    const int start2_val = same_seq == 2 ? buf1 [0].val_ : buf2 [0].val_;
+    const int start1_val =
+        same_seq == 2 ? buf2 [0].data_.val_ : buf1 [0].data_.val_;
+    const int start2_val =
+        same_seq == 2 ? buf1 [0].data_.val_ : buf2 [0].data_.val_;
 
     for (std::size_t i = 0; i < nloops; ++i) {
 
@@ -232,7 +234,7 @@
                   : start1_val + int (i);
             }
 
-            success = buf3 [j].val_ == exp_val;
+            success = buf3 [j].data_.val_ == exp_val;
             if (!success)
                 break;
         }
@@ -243,7 +245,7 @@
                    "expected %d, position %zu",
                    i, algname, it1name, binary, it2name, outname, funname,
                    same_seq, "first", same_seq, "dest",
-                   buf3 [j].val_, exp_val, j + 1);
+                   buf3 [j].data_.val_, exp_val, j + 1);
 
         if (!success)
             break;

Modified: incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.upper.bound.cpp Fri Feb 23 06:57:45 2007
@@ -129,7 +129,7 @@
     // the type of the object is distinct from the iterator's value_type
     // to detect unwarranted assumptions made by the implementation
     Y value (0, 0 /* dummy arguments */);
-    value.xval_.val_ = val_char;
+    value.xval_.data_.val_ = val_char;
 
     // construct the Compare function object to pass to the algorithm
     // when `predicate' is true

Modified: incubator/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.deque.modifiers.cpp Fri Feb 23 06:57:45 2007
@@ -406,12 +406,12 @@
     const Deque::const_iterator resend = deq.end ();
 
     for (Deque::const_iterator it = resbeg; it != resend; ++it) {
-        if ((*it).val_ != UChar (res [it - resbeg])) {
+        if ((*it).data_.val_ != UChar (res [it - resbeg])) {
 
             char* const got = new char [deq.size () + 1];
 
             for (Deque::const_iterator i = resbeg; i != resend; ++i) {
-                got [i - resbeg] = char ((*i).val_);
+                got [i - resbeg] = char ((*i).data_.val_);
             }
 
             got [deq.size ()] = '\0';
@@ -918,7 +918,7 @@
 
         _RWSTD_ASSERT (inx < deq.size ());
 
-        if ((*it).val_ != UChar (res [inx])) {
+        if ((*it).data_.val_ != UChar (res [inx])) {
 
             char* const got = new char [deq.size () + 1];
 
@@ -928,7 +928,7 @@
 
                 _RWSTD_ASSERT (inx_2 < deq.size ());
 
-                got [inx_2] = char ((*i).val_);
+                got [inx_2] = char ((*i).data_.val_);
             }
 
             got [deq.size ()] = '\0';
@@ -1124,12 +1124,12 @@
     const Deque::const_iterator resend = deq.end ();
 
     for (Deque::const_iterator it = resbeg; it != resend; ++it) {
-        if ((*it).val_ != UChar (res [it - resbeg])) {
+        if ((*it).data_.val_ != UChar (res [it - resbeg])) {
 
             char* const got = new char [deq.size () + 1];
 
             for (Deque::const_iterator i = resbeg; i != resend; ++i) {
-                got [i - resbeg] = char ((*i).val_);
+                got [i - resbeg] = char ((*i).data_.val_);
             }
 
             got [deq.size ()] = '\0';

Modified: incubator/stdcxx/trunk/tests/containers/23.vector.modifiers.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/containers/23.vector.modifiers.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/containers/23.vector.modifiers.cpp (original)
+++ incubator/stdcxx/trunk/tests/containers/23.vector.modifiers.cpp Fri Feb 23 06:57:45 2007
@@ -361,12 +361,12 @@
 
         typedef unsigned char UChar;
 
-        if (ptr->val_ != UChar (res [ptr - resbeg])) {
+        if (ptr->data_.val_ != UChar (res [ptr - resbeg])) {
 
             char* const got = new char [vec.size () + 1];
 
             for (Vector::const_pointer p = resbeg; p != resend; ++p) {
-                got [p - resbeg] = char (p->val_);
+                got [p - resbeg] = char (p->data_.val_);
             }
 
             got [vec.size ()] = '\0';

Modified: incubator/stdcxx/trunk/tests/include/rw_value.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/include/rw_value.h?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/include/rw_value.h (original)
+++ incubator/stdcxx/trunk/tests/include/rw_value.h Fri Feb 23 06:57:45 2007
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * rw_value.h - defines a User Defined type
+ * rw_value.h - defines a User Defined Class type and User Defined POD type
  *
  * $Id$
  *
@@ -32,18 +32,58 @@
 #include <testdefs.h>
 #include <alg_test.h>         // for conv_to_bool
 
+/**************************************************************************/
+
+struct UserData
+{
+    int       val_;       // object's value
+};
+
+/**************************************************************************/
+
+struct _TEST_EXPORT UserPOD
+{
+    UserData data_;
+
+    static UserPOD
+    from_char (char c)
+    {
+        UserPOD x;
+        x.data_.val_ = c;
+        return x;
+    }
+
+    // construct an array of objects of type UserPOD each initialized
+    // from the corresponding element of the character array
+    // when the last argument is true and the character array
+    // is not sorted in ascending order the function fails by
+    // returning 0
+    static UserPOD*
+    from_char (const char*, _RWSTD_SIZE_T = _RWSTD_SIZE_MAX,
+               bool = false);
+
+    // returns a pointer to the first element in the sequence of UserClass
+    // whose value is not equal to the corresponding element of
+    // the character string or 0 when no such element exists
+    static const UserPOD* mismatch (const UserPOD*, const char*,
+                                    _RWSTD_SIZE_T /* len */ = _RWSTD_SIZE_MAX);
+};
+
+/**************************************************************************/
+
 // objects of class UserClass maintain a count of their instances in existence,
 // the number of defaut and copy ctor calls, assignment operators, and
 // the number of calls to operator==() and operator<()
 struct _TEST_EXPORT UserClass
 {
-    const int id_;        // a unique non-zero id of the object
-    int       origin_;    // id of the original object that this
-                          // is a (perhaps indirect) copy of (id_
-                          // when this is the original)
-    int       src_id_;    // id of the object that this is a direct
-                          // copy of (id_ when this the original)
-    int       val_;       // object's value
+    UserData   data_;
+
+    const int  id_;        // a unique non-zero id of the object
+    int        origin_;    // id of the original object that this
+                           // is a (perhaps indirect) copy of (id_
+                           // when this is the original)
+    int        src_id_;    // id of the object that this is a direct
+                           // copy of (id_ when this the original)
 
     // number of times the object has been copied into another object,
     // regardless of whether the operation threw an exception or not
@@ -176,6 +216,14 @@
     first_less (const UserClass*, _RWSTD_SIZE_T);
 
     static void reset_totals ();
+
+    static UserClass
+    from_char (char c)
+    {
+        UserClass x;
+        x.data_.val_ = c;
+        return x;
+    }
 
     // construct an array of objects of type UserClass each initialized
     // from the corresponding element of the character array

Modified: incubator/stdcxx/trunk/tests/numerics/26.accumulate.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/numerics/26.accumulate.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/numerics/26.accumulate.cpp (original)
+++ incubator/stdcxx/trunk/tests/numerics/26.accumulate.cpp Fri Feb 23 06:57:45 2007
@@ -129,7 +129,7 @@
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
-        val_ += rhs.val_;
+        data_.val_ += rhs.data_.val_;
         return *this;
     }
 };
@@ -180,7 +180,7 @@
     conv_to_T<Y> operator() (const Y &x, const Y &y) /* non-const */ {
         ++funcalls_;
         Y res (x);
-        res.val_ += y.val_;
+        res.data_.val_ += y.data_.val_;
         return conv_to_T<Y>::make (res);
     }
 
@@ -208,7 +208,7 @@
 
     // construct initial T
     const T init;
-    int sum = init.val_;
+    int sum = init.data_.val_;
 
     T::gen_ = gen_seq;
 
@@ -228,13 +228,13 @@
           : std::accumulate (first, last, init);
 
         // verify the result 26.4.1, p1
-        bool success = sum == res.val_;
+        bool success = sum == res.data_.val_;
         rw_assert (success, 0, __LINE__,
                    "step %zu: accumulate <%s, %s%{?}, %s%{;}> "
                    "= %d, expected %d",
-                   i + 1, itname, tname, 0 != op, opname, res.val_, sum);
+                   i + 1, itname, tname, 0 != op, opname, res.data_.val_, sum);
 
-        sum += buf [i].val_;
+        sum += buf [i].data_.val_;
 
         if (!success)
             break;

Modified: incubator/stdcxx/trunk/tests/numerics/26.adjacent.diff.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/numerics/26.adjacent.diff.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/numerics/26.adjacent.diff.cpp (original)
+++ incubator/stdcxx/trunk/tests/numerics/26.adjacent.diff.cpp Fri Feb 23 06:57:45 2007
@@ -122,7 +122,7 @@
                                      const UserClass &y) /* non-const */ {
         ++funcalls_;
         UserClass res (x);
-        res.val_ -= y.val_;
+        res.data_.val_ -= y.data_.val_;
         return conv_to_T<UserClass>::make (res);
     }
 
@@ -212,9 +212,9 @@
         int* const tmp_val = new int [i + 1];
 
         for (; 0 < k; --k)
-            tmp_val [k] = src [k].val_ - src [k - 1].val_;
+            tmp_val [k] = src [k].data_.val_ - src [k - 1].data_.val_;
 
-        tmp_val [0] = src [0].val_;
+        tmp_val [0] = src [0].data_.val_;
 
         const UserClass* const res =
             alg.adjacent_difference (src, src_end, dst, dst_end, pbinop);
@@ -232,7 +232,7 @@
                    int (i), src, dst_end - dst, res - dst);
 
         for (k = 0; k < i; k++) {
-            success = dst [k].val_ == tmp_val [k];
+            success = dst [k].data_.val_ == tmp_val [k];
             if (!success)
                 break;
         }

Modified: incubator/stdcxx/trunk/tests/numerics/26.inner.product.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/numerics/26.inner.product.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/numerics/26.inner.product.cpp (original)
+++ incubator/stdcxx/trunk/tests/numerics/26.inner.product.cpp Fri Feb 23 06:57:45 2007
@@ -132,7 +132,7 @@
                                      const UserClass &y) /* non-const */ {
         ++funcalls_;
         UserClass res (x);
-        res.val_ += y.val_;
+        res.data_.val_ += y.data_.val_;
         return conv_to_T<UserClass>::make (res);
     }
 
@@ -158,7 +158,7 @@
                                      const UserClass &y) /* non-const */ {
         ++funcalls_;
         UserClass res (x);
-        res.val_ *= y.val_;
+        res.data_.val_ *= y.data_.val_;
         return conv_to_T<UserClass>::make (res);
     }
 
@@ -233,7 +233,7 @@
 
     // construct initial UserClass
     const UserClass init = UserClass ();
-    int sum = init.val_;
+    int sum = init.data_.val_;
 
     UserClass::gen_ = gen_seq;
 
@@ -255,14 +255,14 @@
                                                  init, pbinop1, pbinop2);
 
         // verify the result 26.4.1, p1
-        bool success = sum == res.val_;
+        bool success = sum == res.data_.val_;
         rw_assert (success, 0, __LINE__,
                    "inner_product <%s, %s, %s%{?}, %s, %s%{;}>"
                    "({%{X=+*}}, {%{X=+*}}) == %d, got %d",
                    it1name, it2name, tname, binop, op1name, op2name,
-                   int (i), buf1, int (i), buf2, sum, res.val_);
+                   int (i), buf1, int (i), buf2, sum, res.data_.val_);
 
-        sum += (buf1 [i].val_ * buf2 [i].val_);
+        sum += (buf1 [i].data_.val_ * buf2 [i].data_.val_);
 
         if (!success)
             break;

Modified: incubator/stdcxx/trunk/tests/numerics/26.partial.sum.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/numerics/26.partial.sum.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/numerics/26.partial.sum.cpp (original)
+++ incubator/stdcxx/trunk/tests/numerics/26.partial.sum.cpp Fri Feb 23 06:57:45 2007
@@ -121,7 +121,7 @@
                                      const UserClass &y) /* non-const */ {
         ++funcalls_;
         UserClass res (x);
-        res.val_ += y.val_;
+        res.data_.val_ += y.data_.val_;
         return conv_to_T<UserClass>::make (res);
     }
 
@@ -210,7 +210,7 @@
         std::size_t k = 0;
         int* const tmp_val = new int [i];
         for (; k < i; ++k)
-            tmp_val [k] = src [k].val_;
+            tmp_val [k] = src [k].data_.val_;
 
         const UserClass* const res =
             alg.partial_sum (src, src_end, dst, dst_end, pbinop);
@@ -229,7 +229,7 @@
         int sum = 0;
         for (k = 0; k < i; ++k) {
             sum += tmp_val [k];
-            success = dst [k].val_ == sum;
+            success = dst [k].data_.val_ == sum;
             if (!success)
                 break;
         }

Modified: incubator/stdcxx/trunk/tests/numerics/26.valarray.cons.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/numerics/26.valarray.cons.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/numerics/26.valarray.cons.cpp (original)
+++ incubator/stdcxx/trunk/tests/numerics/26.valarray.cons.cpp Fri Feb 23 06:57:45 2007
@@ -117,7 +117,7 @@
         RW_ASSERT (0 == end || '\0' == *end || ',' == *end);
 
         new (buf + i) UserClass ();
-        buf [i].val_ = int (val);
+        buf [i].data_.val_ = int (val);
 
         if (0 == end || '\0' == *end) {
             while (++i < nelems)
@@ -151,7 +151,7 @@
 
 const std::size_t* count (const UserClass*) { return &UserClass::count_; }
 
-int value (const UserClass &val) { return val.val_; }
+int value (const UserClass &val) { return val.data_.val_; }
 
 /**************************************************************************/
 

Modified: incubator/stdcxx/trunk/tests/self/0.inputiter.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/self/0.inputiter.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/self/0.inputiter.cpp (original)
+++ incubator/stdcxx/trunk/tests/self/0.inputiter.cpp Fri Feb 23 06:57:45 2007
@@ -129,8 +129,8 @@
     FAIL (x [0] = *end0);
     FAIL (x [0] = *end1);
 
-    FAIL (equal = int ('a') == end0->val_);
-    FAIL (equal = int ('a') == end1->val_);
+    FAIL (equal = int ('a') == end0->data_.val_);
+    FAIL (equal = int ('a') == end1->data_.val_);
 
     delete[] x;
 }
@@ -271,9 +271,10 @@
     PASS (y [0] = *it0);
     PASS (y [1] = *it1);
 
-    rw_assert (y [0].val_ == y [1].val_, 0, __LINE__,
+    rw_assert (y [0].data_.val_ == y [1].data_.val_, 0, __LINE__,
                "two copies of InputIter<UserClass> unexpectedly yield "
-               "different values: %d != %d", y [0].val_, y [1].val_);
+               "different values: %d != %d",
+               y [0].data_.val_, y [1].data_.val_);
 
     PASS (it0++);
     FAIL (it1++);        // can't pass through the same iterator twice
@@ -296,13 +297,14 @@
     PASS (y [0] = *it0);
     PASS (y [1] = *it1);
 
-    rw_assert (y [0].val_ == y [1].val_, 0, __LINE__,
+    rw_assert (y [0].data_.val_ == y [1].data_.val_, 0, __LINE__,
                "two copies of InputIter<UserClass> unexpectedly yield "
-               "different values: %d != %d", y [0].val_, y [1].val_);
+               "different values: %d != %d",
+               y [0].data_.val_, y [1].data_.val_);
 
-    rw_assert (y [0].val_ == 'b', 0, __LINE__,
+    rw_assert (y [0].data_.val_ == 'b', 0, __LINE__,
                "InputIter<UserClass>::operator*() == %d, got %d",
-               y [0].val_, 'b');
+               y [0].data_.val_, 'b');
 
     PASS (it1++);
     FAIL (it0++);        // can't pass through the same iterator twice

Modified: incubator/stdcxx/trunk/tests/src/value.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/value.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/src/value.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/value.cpp Fri Feb 23 06:57:45 2007
@@ -1,6 +1,6 @@
 /************************************************************************
  *
- * value.cpp - defines a User Defined type
+ * value.cpp - definitions of UserClass and UserPOD class members
  *
  * $Id$
  *
@@ -36,6 +36,7 @@
 
 
 #include <rw_value.h>
+#include <rw_char.h>    // for rw_expand()
 #include <rw_printf.h>
 
 
@@ -90,7 +91,7 @@
 
 
 UserClass::UserClass ()
-    : id_ (++id_gen_), origin_ (id_), src_id_ (id_), val_ (0),
+    : data_ (), id_ (++id_gen_), origin_ (id_), src_id_ (id_),
       n_copy_ctor_ (0), n_op_assign_ (0), n_op_eq_ (0), n_op_lt_ (0)
 {
     // increment the total number of invocations of the default ctor
@@ -109,7 +110,7 @@
 
     // initialize the object's value
     if (gen_)
-        val_ = gen_ ();
+        data_.val_ = gen_ ();
 
     // increment the number of successfully constructed objects
     ++count_;
@@ -117,8 +118,8 @@
 
 
 UserClass::UserClass (const UserClass &rhs)
-    : id_ (++id_gen_), origin_ (rhs.origin_), src_id_ (rhs.id_),
-      val_ (rhs.val_),
+    : data_ (rhs.data_), id_ (++id_gen_), origin_ (rhs.origin_),
+      src_id_ (rhs.id_),
       n_copy_ctor_ (0), n_op_assign_ (0), n_op_eq_ (0), n_op_lt_ (0)
 {
     // verify id validity
@@ -209,7 +210,7 @@
         p_op       = &n_op_assign_;
         p_throw    = op_assign_throw_ptr_;
         pex        = &ex_assign;
-        new_val    = rhs.val_;
+        new_val    = rhs.data_.val_;
         break;
 
     case op_plus_assign:
@@ -217,7 +218,7 @@
         p_op       = &n_op_plus_assign_;
         p_throw    = op_plus_assign_throw_ptr_;
         pex        = &ex_plus_assign;
-        new_val    = val_ + rhs.val_;
+        new_val    = data_.val_ + rhs.data_.val_;
         break;
 
     case op_minus_assign:
@@ -225,7 +226,7 @@
         p_op       = &n_op_minus_assign_;
         p_throw    = op_minus_assign_throw_ptr_;
         pex        = &ex_minus_assign;
-        new_val    = val_ - rhs.val_;
+        new_val    = data_.val_ - rhs.data_.val_;
         break;
 
     case op_times_assign:
@@ -233,7 +234,7 @@
         p_op       = &n_op_times_assign_;
         p_throw    = op_times_assign_throw_ptr_;
         pex        = &ex_times_assign;
-        new_val    = val_ * rhs.val_;
+        new_val    = data_.val_ * rhs.data_.val_;
         break;
 
     case op_div_assign:
@@ -241,7 +242,7 @@
         p_op       = &n_op_div_assign_;
         p_throw    = op_div_assign_throw_ptr_;
         pex        = &ex_div_assign;
-        new_val    = val_ / rhs.val_;
+        new_val    = data_.val_ / rhs.data_.val_;
         break;
     }
 
@@ -268,7 +269,7 @@
 
     origin_ = rhs.origin_;
     src_id_ = rhs.id_;
-    val_    = new_val;
+    data_.val_    = new_val;
 }
 
 
@@ -350,7 +351,7 @@
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
-    return val_ == rhs.val_;
+    return data_.val_ == rhs.data_.val_;
 }
 
 
@@ -387,7 +388,7 @@
 
 #endif   // _RWSTD_NO_EXCEPTIONS
 
-    return val_ < rhs.val_;
+    return data_.val_ < rhs.data_.val_;
 }
 
 
@@ -466,61 +467,58 @@
 }
 
 
-/* static */ UserClass*
-UserClass::from_char (const char *str, size_t len /* = -1 */,
-                      bool sorted /* = false */)
+template <class T>
+static T*
+__rw_from_char (T*, const char *str, size_t len, bool sorted)
 {
     // handle null pointers
     if (!str)
         return 0;
 
-    // compute the length of the character array if not specified
-    if (size_t (-1) == len)
-        len = strlen (str);
+    // expand source string
+    char str_buf_ [256];
+    size_t strlen_ = sizeof (str_buf_);
+    const char* const str_ = rw_expand (str_buf_, str, len, &strlen_);
 
     if (sorted) {
         // verify that the sequence is sorted
-        for (size_t i = 1; i < len; ++i) {
-            if (str [i] < str [i - 1]) {
+        for (size_t i = 1; i < strlen_; ++i) {
+            if (str_ [i] < str_ [i - 1]) {
+                if (str_buf_ != str_)
+                    delete[] str_;
                 return 0;
             }
         }
     }
 
-    // set the global pointer to point to the beginning of `str'
-    xinit_begin = str;
-
-    // save the previous pointer to the initializer function
-    int (*gen_save)() = UserClass::gen_;
-
-    // set the generating function
-    UserClass::gen_ = xinit;
-
-    UserClass *array = 0;
+    T*array = 0;
 
     _TRY {
-        // allocate and construct `len' elements, initializing
-        // each from the character array `str' (via `xinit')
-        array = new UserClass [len];
+        array = new T [strlen_];
     }
     _CATCH (...) {
 
-        // restore the original initializer function and rethrow
-        UserClass::gen_ = gen_save;
+        if (str_buf_ != str_)
+            delete[] str_;
 
         _RETHROW;
     }
 
-    // restore the original initializer function
-    UserClass::gen_ = gen_save;
+    typedef unsigned char UChar;
+
+    for (size_t i = 0; i < strlen_; ++i)
+        array [i].data_.val_ = UChar (str_ [i]);
+
+    if (str_buf_ != str_)
+        delete[] str_;
 
     return array;
 }
 
 
-/* static */ const UserClass*
-UserClass::mismatch (const UserClass *xarray, const char *str,
-                     size_t len /* = -1 */)
+template <class T>
+static const T*
+__rw_mismatch (const T *xarray, const char *str, size_t len)
 {
     if (!str)
         return xarray;
@@ -532,7 +530,7 @@
 
         const int val = UChar (str [i]);
 
-        if (val != xarray [i].val_)
+        if (val != xarray [i].data_.val_)
             return xarray + i;
     }
 
@@ -540,6 +538,22 @@
 }
 
 
+/* static */ UserClass*
+UserClass::from_char (const char *str, size_t len /* = -1 */,
+                      bool sorted /* = false */)
+{
+    return __rw_from_char ((UserClass*)0, str, len, sorted);
+}
+
+
+/* static */ const UserClass*
+UserClass::mismatch (const UserClass *xarray, const char *str,
+                     size_t len /* = -1 */)
+{
+    return __rw_mismatch (xarray, str, len);
+}
+
+
 /* static */ int
 UserClass::compare (const UserClass *xarray, const char *str,
                     size_t len /* = -1 */)
@@ -549,7 +563,7 @@
     if (px) {
         RW_ASSERT (size_t (px - xarray) < len);
 
-        return px->val_ - int (UChar (str [px - xarray]));
+        return px->data_.val_ - int (UChar (str [px - xarray]));
     }
 
     return 0;
@@ -568,14 +582,30 @@
 UserClass::compare (const UserClass *x, const UserClass *y, size_t count)
 {
     for (size_t i = 0; i != count; ++i) {
-        if (x [i].val_ != y [i].val_)
-            return x [i].val_ - y [i].val_;
+        if (x [i].data_.val_ != y [i].data_.val_)
+            return x [i].data_.val_ - y [i].data_.val_;
     }
 
     return 0;
 }
 
 
+/* static */ UserPOD*
+UserPOD::from_char (const char *str, size_t len /* = -1 */,
+                    bool sorted /* = false */)
+{
+    return __rw_from_char ((UserPOD*)0, str, len, sorted);
+}
+
+
+/* static */ const UserPOD*
+UserPOD::mismatch (const UserPOD *xarray, const char *str,
+                   size_t len /* = -1 */)
+{
+    return __rw_mismatch (xarray, str, len);
+}
+
+
 /* static */ size_t UnaryPredicate::n_total_op_fcall_;
 
 
@@ -639,12 +669,12 @@
     bool result;
 
     switch (op_) {
-    case op_equals:        result = lhs.val_ == rhs.val_; break;
-    case op_not_equals:    result = !(lhs.val_ == rhs.val_); break;
-    case op_less:          result = lhs.val_ < rhs.val_; break;
-    case op_less_equal:    result = !(rhs.val_ < lhs.val_); break;
-    case op_greater:       result = rhs.val_ < lhs.val_; break;
-    case op_greater_equal: result = !(rhs.val_ < lhs.val_); break;
+    case op_equals:        result = lhs.data_.val_ == rhs.data_.val_; break;
+    case op_not_equals:    result = !(lhs.data_.val_ == rhs.data_.val_); break;
+    case op_less:          result = lhs.data_.val_ < rhs.data_.val_; break;
+    case op_less_equal:    result = !(rhs.data_.val_ < lhs.data_.val_); break;
+    case op_greater:       result = rhs.data_.val_ < lhs.data_.val_; break;
+    case op_greater_equal: result = !(rhs.data_.val_ < lhs.data_.val_); break;
     }
 
     return conv_to_bool::make (result);
@@ -671,8 +701,8 @@
     // "X=" [ '#' ] [ '+' ] [ '*' | <n> ] [ '.' [ '*' | '@' | <n> ] ]
     // where
     // '#' causes UserClass::id_ to be included in output
-    // '+' forces UserClass::val_ to be formatted as an integer (otherwise
-    //     it is formatted as an (optionally escaped) character
+    // '+' forces UserClass::data_.val_ to be formatted as an integer (
+    //     otherwise it is formatted as an (optionally escaped) character
     // '*' or <n> is the number of elements in the sequence (the
     //     first occurrence)
     // '*', <n> is the offset of the cursor within the sequence
@@ -687,7 +717,7 @@
     fmt += 2;
 
     if ('+' == *fmt) {
-        // use numerical formatting for UserClass::val_
+        // use numerical formatting for UserClass::data_.val_
         fl_plus = true;
         ++fmt;
     }
@@ -802,9 +832,9 @@
                           "%{?}<%{;}",
                           px == pelem,                    // '>'
                           fl_pound, px->id_,              // "<id>:"
-                          fl_plus, px->val_,              // <val>
+                          fl_plus, px->data_.val_,        // <val>
                           px + 1 < xbeg + nelems,         // ','
-                          px->val_,                       // <val>
+                          px->data_.val_,                 // <val>
                           px == pelem);                   // '<'
         if (n < 0)
             return n;

Modified: incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp?view=diff&rev=510970&r1=510969&r2=510970
==============================================================================
--- incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp (original)
+++ incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp Fri Feb 23 06:57:45 2007
@@ -232,11 +232,11 @@
         // (std::less required to be used in order to satisfy 20.3.3, p8)
         std::pair<Y, Y> p1;
 
-        p0.first.val_  = 1;
-        p0.second.val_ = 2;
+        p0.first.data_.val_  = 1;
+        p0.second.data_.val_ = 2;
 
-        p1.first.val_  = 3;
-        p1.second.val_ = 4;
+        p1.first.data_.val_  = 3;
+        p1.second.data_.val_ = 4;
 
         less_used = 0;
 
@@ -249,7 +249,7 @@
                    "less<Y>::operator() called %d time(s), expected 1",
                    less_used);
 
-        p1.first.val_ = 1;
+        p1.first.data_.val_ = 1;
 
         less_used = 0;
 
@@ -262,7 +262,7 @@
                    "less<Y>::operator() called %d time(s), expected 3",
                    less_used);
 
-        p1.first.val_ = 0;
+        p1.first.data_.val_ = 0;
 
         less_used = 0;
 



Mime
View raw message