Boost logo

Boost :

Subject: [boost] [multiindex] internal scope_guard has changed access from public to protected
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-04-23 08:36:23

Hi Joaquín,

I'm using the scope_guard from multi_index/detail/scope_guard.hpp.

It seems like a revision has made the destructor and copy-constructor
protected instead of private. This is in some sense more idiomatic, but
it breaks a use that I have in my upcomming auto_buffer class. Basically
I'm only constructing a scope_guard object when I know the code can
throw, otherwise I construct a "null" scope_guard which is simply
an instance of scope_guard_impl_base.

Here's the code:

     namespace auto_buffer_detail
         typedef boost::multi_index::detail::scope_guard_impl_base

     boost::has_nothrow_copy<T>::value ?
boost::auto_buffer_detail::null_guard() : \
*this, \
                                  &auto_buffer::deallocate, \
                                  buffer_, members_.capacity_ )

and use it like so:

             boost::multi_index::detail::scope_guard guard =

Any chance you make the two members public again?


Boost list run by bdawes at, gregod at, cpdaniel at, john at