Workaround for bugs #10771 and #6720.

This commit is contained in:
Ion Gaztañaga
2014-12-17 15:45:05 +01:00
parent 281629b94e
commit 12ee566796
9 changed files with 27 additions and 14 deletions

View File

@@ -3765,6 +3765,8 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std
* Reduced compile-time dependencies, headers, and the use of Boost.Preprocessor, specially for hooks and iterators.
* Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/6720 Boost Trac #6720: ['intrusive::unordered_set::clear_and_dispose does not compile on VC11 Beta when passed a stateless lambda]]
* [@https://svn.boost.org/trac/boost/ticket/10771 Boost Trac #10771: ['remove_if is broken for slist]]
* [@https://svn.boost.org/trac/boost/ticket/10853 Boost Trac #10853: ['problem with detection of const_cast_from]]
[endsect]

View File

@@ -35,7 +35,8 @@ namespace intrusive {
template<class NodeTraits, class F>
struct avltree_node_cloner
: private detail::ebo_functor_holder<F>
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder<F>
{
typedef typename NodeTraits::node_ptr node_ptr;
typedef detail::ebo_functor_holder<F> base_t;

View File

@@ -243,6 +243,7 @@ struct get_compare<void, T>
template<class ValueTraits, class VoidOrKeyComp, algo_types AlgoType, typename HeaderHolder>
struct bstbase2
//Put the (possibly empty) functor in the first position to get EBO in MSVC
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder<typename get_compare< VoidOrKeyComp
, typename ValueTraits::value_type
>::type>

View File

@@ -26,7 +26,8 @@ namespace detail {
template<class KeyValueCompare, class ValueTraits>
struct key_nodeptr_comp
: private ebo_functor_holder<KeyValueCompare>
//Use public inheritance to avoid MSVC bugs with closures
: public ebo_functor_holder<KeyValueCompare>
{
typedef ValueTraits value_traits;
typedef typename value_traits::value_type value_type;

View File

@@ -28,7 +28,8 @@ namespace detail {
template<class F, class ValueTraits, algo_types AlgoType>
struct node_cloner
: private ebo_functor_holder<F>
//Use public inheritance to avoid MSVC bugs with closures
: public ebo_functor_holder<F>
{
typedef ValueTraits value_traits;
typedef typename value_traits::node_traits node_traits;
@@ -78,7 +79,8 @@ struct node_cloner
template<class F, class ValueTraits, algo_types AlgoType>
struct node_disposer
: private ebo_functor_holder<F>
//Use public inheritance to avoid MSVC bugs with closures
: public ebo_functor_holder<F>
{
typedef ValueTraits value_traits;
typedef typename value_traits::node_traits node_traits;

View File

@@ -555,7 +555,8 @@ struct downcast_node_to_value_t
template<class F, class SlistNodePtr, class NodePtr>
struct node_cast_adaptor
: private detail::ebo_functor_holder<F>
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder<F>
{
typedef detail::ebo_functor_holder<F> base_t;
@@ -805,6 +806,7 @@ struct get_hash<void, T>
//Stores bucket_plus_vtraits plust the hash function
template<class VoidOrKeyHash, class ValueTraits, class BucketTraits>
struct bucket_hash_t
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder
<typename get_hash< VoidOrKeyHash
, typename bucket_plus_vtraits<ValueTraits,BucketTraits>::value_traits::value_type
@@ -857,6 +859,7 @@ struct get_equal_to<void, T>
//non-empty bucket shall not be cached.
template<class VoidOrKeyHash, class VoidOrKeyEqual, class ValueTraits, class BucketTraits, bool>
struct bucket_hash_equal_t
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder //equal
<typename get_equal_to< VoidOrKeyEqual
, typename bucket_plus_vtraits<ValueTraits,BucketTraits>::value_traits::value_type
@@ -934,6 +937,7 @@ struct bucket_hash_equal_t
//non-empty bucket shall be cached.
template<class VoidOrKeyHash, class VoidOrKeyEqual, class ValueTraits, class BucketTraits> //cache_begin == true version
struct bucket_hash_equal_t<VoidOrKeyHash, VoidOrKeyEqual, ValueTraits, BucketTraits, true>
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder //equal
<typename get_equal_to< VoidOrKeyEqual
, typename bucket_plus_vtraits<ValueTraits,BucketTraits>::value_traits::value_type

View File

@@ -34,15 +34,15 @@ namespace intrusive {
namespace detail {
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1310)
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_pointer_to, pointer_to);
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_dynamic_cast_from, dynamic_cast_from);
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_static_cast_from, static_cast_from);
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_const_cast_from, const_cast_from);
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_pointer_to, pointer_to)
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_dynamic_cast_from, dynamic_cast_from)
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_static_cast_from, static_cast_from)
BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_member_function_callable_with_const_cast_from, const_cast_from)
#else
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_pointer_to, pointer_to);
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_dynamic_cast_from, dynamic_cast_from);
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_static_cast_from, static_cast_from);
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_const_cast_from, const_cast_from);
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_pointer_to, pointer_to)
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_dynamic_cast_from, dynamic_cast_from)
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_static_cast_from, static_cast_from)
BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED_IGNORE_SIGNATURE(has_member_function_callable_with_const_cast_from, const_cast_from)
#endif
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(element_type)

View File

@@ -44,7 +44,8 @@ namespace intrusive {
template<class NodeTraits, class F>
struct rbtree_node_cloner
: private detail::ebo_functor_holder<F>
//Use public inheritance to avoid MSVC bugs with closures
: public detail::ebo_functor_holder<F>
{
typedef typename NodeTraits::node_ptr node_ptr;
typedef detail::ebo_functor_holder<F> base_t;

View File

@@ -80,6 +80,7 @@ template<class ValueTraits, class VoidOrKeyComp, class VoidOrPrioComp, class Siz
class treap_impl
/// @cond
: public bstree_impl<ValueTraits, VoidOrKeyComp, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
//Use public inheritance to avoid MSVC bugs with closures
, public detail::ebo_functor_holder
< typename get_prio
< VoidOrPrioComp