summaryrefslogtreecommitdiff
path: root/boost/signals2/detail
diff options
context:
space:
mode:
Diffstat (limited to 'boost/signals2/detail')
-rw-r--r--boost/signals2/detail/auto_buffer.hpp21
-rw-r--r--boost/signals2/detail/slot_call_iterator.hpp4
2 files changed, 15 insertions, 10 deletions
diff --git a/boost/signals2/detail/auto_buffer.hpp b/boost/signals2/detail/auto_buffer.hpp
index 4c55a751ae..5ff8dd2c63 100644
--- a/boost/signals2/detail/auto_buffer.hpp
+++ b/boost/signals2/detail/auto_buffer.hpp
@@ -248,6 +248,14 @@ namespace detail
auto_buffer_destroy( where, boost::has_trivial_destructor<T>() );
}
+ void auto_buffer_destroy()
+ {
+ BOOST_ASSERT( is_valid() );
+ if( buffer_ ) // do we need this check? Yes, but only
+ // for N = 0u + local instances in one_sided_swap()
+ auto_buffer_destroy( boost::has_trivial_destructor<T>() );
+ }
+
void destroy_back_n( size_type n, const boost::false_type& )
{
BOOST_ASSERT( n > 0 );
@@ -301,7 +309,7 @@ namespace detail
{
pointer new_buffer = move_to_new_buffer( new_capacity,
boost::has_nothrow_copy<T>() );
- (*this).~auto_buffer();
+ auto_buffer_destroy();
buffer_ = new_buffer;
members_.capacity_ = new_capacity;
BOOST_ASSERT( size_ <= members_.capacity_ );
@@ -355,7 +363,7 @@ namespace detail
void one_sided_swap( auto_buffer& temp ) // nothrow
{
BOOST_ASSERT( !temp.is_on_stack() );
- this->~auto_buffer();
+ auto_buffer_destroy();
// @remark: must be nothrow
get_allocator() = temp.get_allocator();
members_.capacity_ = temp.members_.capacity_;
@@ -506,7 +514,7 @@ namespace detail
{
// @remark: we release memory as early as possible
// since we only give the basic guarantee
- (*this).~auto_buffer();
+ auto_buffer_destroy();
buffer_ = 0;
pointer new_buffer = allocate( r.size() );
boost::multi_index::detail::scope_guard guard =
@@ -597,10 +605,7 @@ namespace detail
~auto_buffer()
{
- BOOST_ASSERT( is_valid() );
- if( buffer_ ) // do we need this check? Yes, but only
- // for N = 0u + local instances in one_sided_swap()
- auto_buffer_destroy( boost::has_trivial_destructor<T>() );
+ auto_buffer_destroy();
}
public:
@@ -1033,7 +1038,7 @@ namespace detail
pointer new_buffer = static_cast<T*>(other->members_.address());
copy_impl( one_on_stack->begin(), one_on_stack->end(),
new_buffer ); // strong
- one_on_stack->~auto_buffer(); // nothrow
+ one_on_stack->auto_buffer_destroy(); // nothrow
boost::swap( get_allocator(), r.get_allocator() ); // assume nothrow
boost::swap( members_.capacity_, r.members_.capacity_ );
boost::swap( size_, r.size_ );
diff --git a/boost/signals2/detail/slot_call_iterator.hpp b/boost/signals2/detail/slot_call_iterator.hpp
index 9fee16ec69..769f6c222d 100644
--- a/boost/signals2/detail/slot_call_iterator.hpp
+++ b/boost/signals2/detail/slot_call_iterator.hpp
@@ -78,12 +78,12 @@ namespace boost {
: public boost::iterator_facade<slot_call_iterator_t<Function, Iterator, ConnectionBody>,
typename Function::result_type,
boost::single_pass_traversal_tag,
- typename boost::add_const<typename boost::add_reference<typename Function::result_type>::type>::type >
+ typename boost::add_reference<typename boost::add_const<typename Function::result_type>::type>::type >
{
typedef boost::iterator_facade<slot_call_iterator_t<Function, Iterator, ConnectionBody>,
typename Function::result_type,
boost::single_pass_traversal_tag,
- typename boost::add_const<typename boost::add_reference<typename Function::result_type>::type>::type >
+ typename boost::add_reference<typename boost::add_const<typename Function::result_type>::type>::type >
inherited;
typedef typename Function::result_type result_type;