diff DEPENDENCIES/generic/include/boost/intrusive/any_hook.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/intrusive/any_hook.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/intrusive/any_hook.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -15,23 +15,19 @@
 
 #include <boost/intrusive/detail/config_begin.hpp>
 #include <boost/intrusive/intrusive_fwd.hpp>
-#include <boost/intrusive/detail/utilities.hpp>
 #include <boost/intrusive/detail/any_node_and_algorithms.hpp>
 #include <boost/intrusive/options.hpp>
 #include <boost/intrusive/detail/generic_hook.hpp>
-#include <boost/intrusive/pointer_traits.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/pointer_rebind.hpp>
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+#  pragma once
+#endif
 
 namespace boost {
 namespace intrusive {
 
-/// @cond
-template<class VoidPointer>
-struct get_any_node_algo
-{
-   typedef any_algorithms<VoidPointer> type;
-};
-/// @endcond
-
 //! Helper metafunction to define a \c \c any_base_hook that yields to the same
 //! type when the same options (either explicitly or implicitly) are used.
 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
@@ -52,7 +48,7 @@
       >::type packed_options;
 
    typedef generic_hook
-   < get_any_node_algo<typename packed_options::void_pointer>
+   < any_algorithms<typename packed_options::void_pointer>
    , typename packed_options::tag
    , packed_options::link_mode
    , AnyBaseHookId
@@ -75,7 +71,7 @@
 //! \c link_mode<> will specify the linking mode of the hook (\c normal_link, \c safe_link).
 //!
 //! \c void_pointer<> is the pointer type that will be used internally in the hook
-//! and the the container configured to use this hook.
+//! and the container configured to use this hook.
 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
 template<class ...Options>
 #else
@@ -157,7 +153,7 @@
       >::type packed_options;
 
    typedef generic_hook
-   < get_any_node_algo<typename packed_options::void_pointer>
+   < any_algorithms<typename packed_options::void_pointer>
    , member_tag
    , packed_options::link_mode
    , NoBaseHookId
@@ -175,7 +171,7 @@
 //! \c link_mode<> will specify the linking mode of the hook (\c normal_link or \c safe_link).
 //!
 //! \c void_pointer<> is the pointer type that will be used internally in the hook
-//! and the the container configured to use this hook.
+//! and the container configured to use this hook.
 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
 template<class ...Options>
 #else
@@ -241,39 +237,34 @@
 
 namespace detail{
 
-template<class ValueTraits>
-struct any_to_get_base_pointer_type
-{
-   typedef typename pointer_traits<typename ValueTraits::hooktags::node_traits::node_ptr>::template
-      rebind_pointer<void>::type type;
-};
-
-template<class ValueTraits>
-struct any_to_get_member_pointer_type
-{
-   typedef typename pointer_traits
-      <typename ValueTraits::node_ptr>::template rebind_pointer<void>::type type;
-};
+BOOST_INTRUSIVE_INTERNAL_STATIC_BOOL_IS_TRUE(old_proto_value_traits_base_hook, hooktags::is_base_hook)
 
 //!This option setter specifies that the container
 //!must use the specified base hook
-template<class BaseHook, template <class> class NodeTraits>
+template<class BasicHook, template <class> class NodeTraits>
 struct any_to_some_hook
 {
-   typedef typename BaseHook::template pack<empty>::proto_value_traits old_proto_value_traits;
+   typedef typename BasicHook::template pack<empty>::proto_value_traits old_proto_value_traits;
 
    template<class Base>
    struct pack : public Base
    {
-      struct proto_value_traits : public old_proto_value_traits
+      struct proto_value_traits
       {
+         //proto_value_traits::hooktags::is_base_hook is used by get_value_traits
+         //to detect base hooks, so mark it in case BasicHook has it.
+         struct hooktags
+         {
+            static const bool is_base_hook = old_proto_value_traits_base_hook_bool_is_true
+               <old_proto_value_traits>::value;
+         };
+
+         typedef old_proto_value_traits basic_hook_t;
          static const bool is_any_hook = true;
-         typedef typename detail::eval_if_c
-            < detail::internal_base_hook_bool_is_true<old_proto_value_traits>::value
-            , any_to_get_base_pointer_type<old_proto_value_traits>
-            , any_to_get_member_pointer_type<old_proto_value_traits>
-            >::type void_pointer;
-         typedef NodeTraits<void_pointer> node_traits;
+
+         template<class VoidPtr>
+         struct node_traits_from_voidptr
+         {  typedef NodeTraits<VoidPtr> type;  };
       };
    };
 };
@@ -284,55 +275,55 @@
 
 //!This option setter specifies that
 //!any hook should behave as an slist hook
-template<class BaseHook>
+template<class BasicHook>
 struct any_to_slist_hook
 /// @cond
-   :  public detail::any_to_some_hook<BaseHook, any_slist_node_traits>
+   :  public detail::any_to_some_hook<BasicHook, any_slist_node_traits>
 /// @endcond
 {};
 
 //!This option setter specifies that
 //!any hook should behave as an list hook
-template<class BaseHook>
+template<class BasicHook>
 struct any_to_list_hook
 /// @cond
-   :  public detail::any_to_some_hook<BaseHook, any_list_node_traits>
+   :  public detail::any_to_some_hook<BasicHook, any_list_node_traits>
 /// @endcond
 {};
 
 //!This option setter specifies that
 //!any hook should behave as a set hook
-template<class BaseHook>
+template<class BasicHook>
 struct any_to_set_hook
 /// @cond
-   :  public detail::any_to_some_hook<BaseHook, any_rbtree_node_traits>
+   :  public detail::any_to_some_hook<BasicHook, any_rbtree_node_traits>
 /// @endcond
 {};
 
 //!This option setter specifies that
 //!any hook should behave as an avl_set hook
-template<class BaseHook>
+template<class BasicHook>
 struct any_to_avl_set_hook
 /// @cond
-   :  public detail::any_to_some_hook<BaseHook, any_avltree_node_traits>
+   :  public detail::any_to_some_hook<BasicHook, any_avltree_node_traits>
 /// @endcond
 {};
 
 //!This option setter specifies that any
 //!hook should behave as a bs_set hook
-template<class BaseHook>
+template<class BasicHook>
 struct any_to_bs_set_hook
 /// @cond
-   :  public detail::any_to_some_hook<BaseHook, any_tree_node_traits>
+   :  public detail::any_to_some_hook<BasicHook, any_tree_node_traits>
 /// @endcond
 {};
 
 //!This option setter specifies that any hook
 //!should behave as an unordered set hook
-template<class BaseHook>
+template<class BasicHook>
 struct any_to_unordered_set_hook
 /// @cond
-   :  public detail::any_to_some_hook<BaseHook, any_unordered_node_traits>
+   :  public detail::any_to_some_hook<BasicHook, any_unordered_node_traits>
 /// @endcond
 {};