Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80371 - trunk/boost/lockfree
From: tim_at_[hidden]
Date: 2012-09-03 06:05:55


Author: timblechmann
Date: 2012-09-03 06:05:54 EDT (Mon, 03 Sep 2012)
New Revision: 80371
URL: http://svn.boost.org/trac/boost/changeset/80371

Log:
lockfree: convert compile-time assertions to run-time assertions

patch by hartmut kaiser

Signed-off-by: Tim Blechmann <tim_at_[hidden]>
Text files modified:
   trunk/boost/lockfree/queue.hpp | 7 ++++---
   trunk/boost/lockfree/spsc_queue.hpp | 9 +++++----
   trunk/boost/lockfree/stack.hpp | 7 ++++---
   3 files changed, 13 insertions(+), 10 deletions(-)

Modified: trunk/boost/lockfree/queue.hpp
==============================================================================
--- trunk/boost/lockfree/queue.hpp (original)
+++ trunk/boost/lockfree/queue.hpp 2012-09-03 06:05:54 EDT (Mon, 03 Sep 2012)
@@ -13,6 +13,7 @@
 
 #include <memory> /* std::auto_ptr */
 
+#include <boost/assert.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/has_trivial_assign.hpp>
@@ -152,7 +153,7 @@
         tail_(tagged_node_handle(0, 0)),
         pool(node_allocator(), capacity)
     {
- BOOST_STATIC_ASSERT(has_capacity);
+ BOOST_ASSERT(has_capacity);
         initialize();
     }
 
@@ -171,7 +172,7 @@
         tail_(tagged_node_handle(0, 0)),
         pool(alloc, capacity)
     {
- BOOST_STATIC_ASSERT(has_capacity);
+ BOOST_ASSERT(has_capacity);
         initialize();
     }
     // @}
@@ -183,7 +184,7 @@
         tail_(tagged_node_handle(0, 0)),
         pool(node_allocator(), n + 1)
     {
- BOOST_STATIC_ASSERT(!has_capacity);
+ BOOST_ASSERT(!has_capacity);
         initialize();
     }
 

Modified: trunk/boost/lockfree/spsc_queue.hpp
==============================================================================
--- trunk/boost/lockfree/spsc_queue.hpp (original)
+++ trunk/boost/lockfree/spsc_queue.hpp 2012-09-03 06:05:54 EDT (Mon, 03 Sep 2012)
@@ -13,6 +13,7 @@
 #include <algorithm>
 
 #include <boost/array.hpp>
+#include <boost/assert.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/static_assert.hpp>
 
@@ -496,7 +497,7 @@
     // @{
     spsc_queue(void)
     {
- BOOST_STATIC_ASSERT(!runtime_sized);
+ BOOST_ASSERT(!runtime_sized);
     }
 
     template <typename U>
@@ -509,7 +510,7 @@
     explicit spsc_queue(allocator const & alloc)
     {
         // just for API compatibility: we don't actually need an allocator
- BOOST_STATIC_ASSERT(!runtime_sized);
+ BOOST_ASSERT(!runtime_sized);
     }
     // @}
 
@@ -522,7 +523,7 @@
     explicit spsc_queue(size_type element_count):
         base_type(element_count)
     {
- BOOST_STATIC_ASSERT(runtime_sized);
+ BOOST_ASSERT(runtime_sized);
     }
 
     template <typename U>
@@ -535,7 +536,7 @@
     spsc_queue(size_type element_count, allocator_arg const & alloc):
         base_type(alloc, element_count)
     {
- BOOST_STATIC_ASSERT(runtime_sized);
+ BOOST_ASSERT(runtime_sized);
     }
     // @}
 

Modified: trunk/boost/lockfree/stack.hpp
==============================================================================
--- trunk/boost/lockfree/stack.hpp (original)
+++ trunk/boost/lockfree/stack.hpp 2012-09-03 06:05:54 EDT (Mon, 03 Sep 2012)
@@ -7,6 +7,7 @@
 #ifndef BOOST_LOCKFREE_STACK_HPP_INCLUDED
 #define BOOST_LOCKFREE_STACK_HPP_INCLUDED
 
+#include <boost/assert.hpp>
 #include <boost/checked_delete.hpp>
 #include <boost/integer_traits.hpp>
 #include <boost/noncopyable.hpp>
@@ -131,7 +132,7 @@
     stack(void):
         pool(node_allocator(), capacity)
     {
- BOOST_STATIC_ASSERT(has_capacity);
+ BOOST_ASSERT(has_capacity);
         initialize();
     }
 
@@ -146,7 +147,7 @@
     explicit stack(allocator const & alloc):
         pool(alloc, capacity)
     {
- BOOST_STATIC_ASSERT(has_capacity);
+ BOOST_ASSERT(has_capacity);
         initialize();
     }
     // @}
@@ -156,7 +157,7 @@
     explicit stack(size_type n):
         pool(node_allocator(), n)
     {
- BOOST_STATIC_ASSERT(!has_capacity);
+ BOOST_ASSERT(!has_capacity);
         initialize();
     }
 


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