stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r372411 - /incubator/stdcxx/trunk/include/algorithm.cc
Date Thu, 26 Jan 2006 02:52:12 GMT
Author: sebor
Date: Wed Jan 25 18:52:09 2006
New Revision: 372411

URL: http://svn.apache.org/viewcvs?rev=372411&view=rev
Log:
2006-01-25  Martin Sebor  <sebor@roguewave.com>

	* algorithm.cc (random_shuffle): Asserted a precondition.

Modified:
    incubator/stdcxx/trunk/include/algorithm.cc

Modified: incubator/stdcxx/trunk/include/algorithm.cc
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/algorithm.cc?rev=372411&r1=372410&r2=372411&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/algorithm.cc (original)
+++ incubator/stdcxx/trunk/include/algorithm.cc Wed Jan 25 18:52:09 2006
@@ -604,6 +604,9 @@
             // and to the iterator's difference_type but nothing else
             const _DiffT __rndoff (__rand (__limit));
 
+            // returned value must be non-negative and less than the limit
+            _RWSTD_ASSERT (0 <= __rndoff && __rndoff < __limit);
+
             _STD::iter_swap (__i, __first + __rndoff);
         }
     }



Mime
View raw message