Boost logo

Boost-Commit :

From: garcia_at_[hidden]
Date: 2007-08-21 09:54:59


Author: garcia
Date: 2007-08-21 09:54:58 EDT (Tue, 21 Aug 2007)
New Revision: 38821
URL: http://svn.boost.org/trac/boost/changeset/38821

Log:
Changed all uses of assert to BOOST_ASSERT.

Text files modified:
   trunk/boost/multi_array/copy_array.hpp | 6 +++---
   trunk/boost/multi_array/multi_array_ref.hpp | 20 ++++++++++----------
   trunk/boost/multi_array/subarray.hpp | 13 +++++++------
   trunk/boost/multi_array/view.hpp | 18 ++++++++----------
   4 files changed, 28 insertions(+), 29 deletions(-)

Modified: trunk/boost/multi_array/copy_array.hpp
==============================================================================
--- trunk/boost/multi_array/copy_array.hpp (original)
+++ trunk/boost/multi_array/copy_array.hpp 2007-08-21 09:54:58 EDT (Tue, 21 Aug 2007)
@@ -19,7 +19,7 @@
 // shape
 //
 #include "boost/type.hpp"
-#include <cassert>
+#include "boost/assert.hpp"
 
 namespace boost {
 namespace detail {
@@ -52,8 +52,8 @@
 
 template <typename Array1, typename Array2>
 void copy_array (Array1& source, Array2& dest) {
- assert(std::equal(source.shape(),source.shape()+source.num_dimensions(),
- dest.shape()));
+ BOOST_ASSERT(std::equal(source.shape(),source.shape()+source.num_dimensions(),
+ dest.shape()));
   // Dispatch to the proper function
   typedef typename Array1::element element_type;
   copy_dispatch<element_type>::

Modified: trunk/boost/multi_array/multi_array_ref.hpp
==============================================================================
--- trunk/boost/multi_array/multi_array_ref.hpp (original)
+++ trunk/boost/multi_array/multi_array_ref.hpp 2007-08-21 09:54:58 EDT (Tue, 21 Aug 2007)
@@ -31,7 +31,6 @@
 #include "boost/functional.hpp"
 #include "boost/limits.hpp"
 #include <algorithm>
-#include <cassert>
 #include <cstddef>
 #include <functional>
 #include <numeric>
@@ -165,9 +164,9 @@
   void reshape(const SizeList& extents) {
     boost::function_requires<
       detail::multi_array::CollectionConcept<SizeList> >();
- assert(num_elements_ ==
- std::accumulate(extents.begin(),extents.end(),
- size_type(1),std::multiplies<size_type>()));
+ BOOST_ASSERT(num_elements_ ==
+ std::accumulate(extents.begin(),extents.end(),
+ size_type(1),std::multiplies<size_type>()));
 
     std::copy(extents.begin(),extents.end(),extent_list_.begin());
     this->compute_strides(stride_list_,extent_list_,storage_);
@@ -483,9 +482,9 @@
       ConstMultiArrayConcept<ConstMultiArray,NumDims> >();
 
     // make sure the dimensions agree
- assert(other.num_dimensions() == this->num_dimensions());
- assert(std::equal(other.shape(),other.shape()+this->num_dimensions(),
- this->shape()));
+ BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
+ BOOST_ASSERT(std::equal(other.shape(),other.shape()+this->num_dimensions(),
+ this->shape()));
     // iterator-based copy
     std::copy(other.begin(),other.end(),this->begin());
     return *this;
@@ -495,9 +494,10 @@
     if (&other != this) {
       // make sure the dimensions agree
       
- assert(other.num_dimensions() == this->num_dimensions());
- assert(std::equal(other.shape(),other.shape()+this->num_dimensions(),
- this->shape()));
+ BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
+ BOOST_ASSERT(std::equal(other.shape(),
+ other.shape()+this->num_dimensions(),
+ this->shape()));
       // iterator-based copy
       std::copy(other.begin(),other.end(),this->begin());
     }

Modified: trunk/boost/multi_array/subarray.hpp
==============================================================================
--- trunk/boost/multi_array/subarray.hpp (original)
+++ trunk/boost/multi_array/subarray.hpp 2007-08-21 09:54:58 EDT (Tue, 21 Aug 2007)
@@ -235,9 +235,9 @@
         ConstMultiArray, NumDims> >();
 
     // make sure the dimensions agree
- assert(other.num_dimensions() == this->num_dimensions());
- assert(std::equal(other.shape(),other.shape()+this->num_dimensions(),
- this->shape()));
+ BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
+ BOOST_ASSERT(std::equal(other.shape(),other.shape()+this->num_dimensions(),
+ this->shape()));
     // iterator-based copy
     std::copy(other.begin(),other.end(),begin());
     return *this;
@@ -247,9 +247,10 @@
   sub_array& operator=(const sub_array& other) {
     if (&other != this) {
       // make sure the dimensions agree
- assert(other.num_dimensions() == this->num_dimensions());
- assert(std::equal(other.shape(),other.shape()+this->num_dimensions(),
- this->shape()));
+ BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
+ BOOST_ASSERT(std::equal(other.shape(),
+ other.shape()+this->num_dimensions(),
+ this->shape()));
       // iterator-based copy
       std::copy(other.begin(),other.end(),begin());
     }

Modified: trunk/boost/multi_array/view.hpp
==============================================================================
--- trunk/boost/multi_array/view.hpp (original)
+++ trunk/boost/multi_array/view.hpp 2007-08-21 09:54:58 EDT (Tue, 21 Aug 2007)
@@ -244,10 +244,7 @@
 
     // Calculate the array size
     num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
- size_type(1),std::multiplies<size_type>());
-#if 0
- assert(num_elements_ != 0);
-#endif
+ size_type(1),std::multiplies<size_type>());
   }
 
   typedef boost::array<size_type,NumDims> size_list;
@@ -304,9 +301,9 @@
       ConstMultiArrayConcept<ConstMultiArray,NumDims> >();
 
     // make sure the dimensions agree
- assert(other.num_dimensions() == this->num_dimensions());
- assert(std::equal(other.shape(),other.shape()+this->num_dimensions(),
- this->shape()));
+ BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
+ BOOST_ASSERT(std::equal(other.shape(),other.shape()+this->num_dimensions(),
+ this->shape()));
     // iterator-based copy
     std::copy(other.begin(),other.end(),begin());
     return *this;
@@ -316,9 +313,10 @@
   multi_array_view& operator=(const multi_array_view& other) {
     if (&other != this) {
       // make sure the dimensions agree
- assert(other.num_dimensions() == this->num_dimensions());
- assert(std::equal(other.shape(),other.shape()+this->num_dimensions(),
- this->shape()));
+ BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
+ BOOST_ASSERT(std::equal(other.shape(),
+ other.shape()+this->num_dimensions(),
+ this->shape()));
       // iterator-based copy
       std::copy(other.begin(),other.end(),begin());
     }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk