Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Ion Gaztanaga 2007-2013 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/intrusive for documentation. Chris@16: // Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #ifndef BOOST_INTRUSIVE_OPTIONS_HPP Chris@16: #define BOOST_INTRUSIVE_OPTIONS_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: Chris@16: namespace boost { Chris@16: namespace intrusive { Chris@16: Chris@16: /// @cond Chris@16: Chris@16: //typedef void default_tag; Chris@16: struct default_tag; Chris@16: struct member_tag; Chris@16: Chris@16: namespace detail{ Chris@16: Chris@16: struct default_hook_tag{}; Chris@16: Chris@16: #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED Chris@16: Chris@16: #define BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER) \ Chris@16: struct BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER : public default_hook_tag\ Chris@16: {\ Chris@16: template \ Chris@16: struct apply\ Chris@16: { typedef typename T::BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER type; };\ Chris@16: }\ Chris@16: Chris@16: BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_list_hook); Chris@16: BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_slist_hook); Chris@16: BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_rbtree_hook); Chris@16: BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_hashtable_hook); Chris@16: BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_avltree_hook); Chris@16: BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_bstree_hook); Chris@16: //BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_splaytree_hook); Chris@16: //BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_sgtree_hook); Chris@16: //BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_treap_hook); Chris@16: Chris@16: #undef BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION Chris@16: Chris@16: #endif //BOOST_INTRUSIVE_DOXYGEN_INVOKED Chris@16: Chris@16: template Chris@16: struct eval_value_traits Chris@16: { Chris@16: typedef typename ValueTraits::value_traits type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_real_value_traits Chris@16: : public eval_if_c Chris@16: < external_value_traits_bool_is_true::value Chris@16: , eval_value_traits Chris@16: , identity Chris@16: > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct eval_bucket_traits Chris@16: { Chris@16: typedef typename BucketTraits::bucket_traits type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct concrete_hook_base_value_traits Chris@16: { Chris@16: typedef typename BaseHook::hooktags tags; Chris@16: typedef bhtraits Chris@16: < T Chris@16: , typename tags::node_traits Chris@16: , tags::link_mode Chris@16: , typename tags::tag Chris@16: , tags::type> type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct concrete_hook_base_node_traits Chris@16: { typedef typename BaseHook::hooktags::node_traits type; }; Chris@16: Chris@16: template Chris@16: struct any_hook_base_value_traits Chris@16: { Chris@16: //AnyToSomeHook value_traits derive from a generic_hook Chris@16: //The generic_hook is configured with any_node_traits Chris@16: //and AnyToSomeHook::value_traits with the correct Chris@16: //node traits for the container, so use node_traits Chris@16: //from AnyToSomeHook_ProtoValueTraits and the rest of Chris@16: //elements from the hooktags member of the generic_hook Chris@16: typedef AnyToSomeHook_ProtoValueTraits proto_value_traits; Chris@16: typedef bhtraits Chris@16: < T Chris@16: , typename proto_value_traits::node_traits Chris@16: , proto_value_traits::hooktags::link_mode Chris@16: , typename proto_value_traits::hooktags::tag Chris@16: , proto_value_traits::hooktags::type Chris@16: > type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct any_hook_base_node_traits Chris@16: { typedef typename BaseHook::node_traits type; }; Chris@16: Chris@16: template Chris@16: struct get_base_value_traits Chris@16: { Chris@16: typedef typename detail::eval_if_c Chris@16: < internal_any_hook_bool_is_true::value Chris@16: , any_hook_base_value_traits Chris@16: , concrete_hook_base_value_traits Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_base_node_traits Chris@16: { Chris@16: typedef typename detail::eval_if_c Chris@16: < internal_any_hook_bool_is_true::value Chris@16: , any_hook_base_node_traits Chris@16: , concrete_hook_base_node_traits Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_member_value_traits Chris@16: { Chris@16: typedef typename MemberHook::member_value_traits type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_member_node_traits Chris@16: { Chris@16: typedef typename MemberHook::member_value_traits::node_traits type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_value_traits Chris@16: { Chris@16: typedef typename detail::eval_if_c Chris@16: ::value Chris@16: ,detail::apply Chris@16: ,detail::identity Chris@16: >::type supposed_value_traits; Chris@16: Chris@16: //...if it's a default hook Chris@16: typedef typename detail::eval_if_c Chris@16: < internal_base_hook_bool_is_true::value Chris@16: //...get it's internal value traits using Chris@16: //the provided T value type. Chris@16: , get_base_value_traits Chris@16: //...else use it's internal value traits tag Chris@16: //(member hooks and custom value traits are in this group) Chris@16: , detail::eval_if_c Chris@16: < internal_member_value_traits::value Chris@16: , get_member_value_traits Chris@16: , detail::identity Chris@16: > Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_explicit_node_traits Chris@16: { Chris@16: typedef typename ValueTraits::node_traits type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct get_node_traits Chris@16: { Chris@16: typedef SupposedValueTraits supposed_value_traits; Chris@16: //...if it's a base hook Chris@16: typedef typename detail::eval_if_c Chris@16: < internal_base_hook_bool_is_true::value Chris@16: //...get it's internal value traits using Chris@16: //the provided T value type. Chris@16: , get_base_node_traits Chris@16: //...else use it's internal value traits tag Chris@16: //(member hooks and custom value traits are in this group) Chris@16: , detail::eval_if_c Chris@16: < internal_member_value_traits::value Chris@16: , get_member_node_traits Chris@16: , get_explicit_node_traits Chris@16: > Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: } //namespace detail{ Chris@16: Chris@16: /// @endcond Chris@16: Chris@16: //!This option setter specifies if the intrusive Chris@16: //!container stores its size as a member to Chris@16: //!obtain constant-time size() member. Chris@16: template Chris@16: struct constant_time_size Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool constant_time_size = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the type that Chris@16: //!the container will use to store its size. Chris@16: template Chris@16: struct size_type Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef SizeType size_type; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the strict weak ordering Chris@16: //!comparison functor for the value type Chris@16: template Chris@16: struct compare Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef Compare compare; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter for scapegoat containers specifies if Chris@16: //!the intrusive scapegoat container should use a non-variable Chris@16: //!alpha value that does not need floating-point operations. Chris@16: //! Chris@16: //!If activated, the fixed alpha value is 1/sqrt(2). This Chris@16: //!option also saves some space in the container since Chris@16: //!the alpha value and some additional data does not need Chris@16: //!to be stored in the container. Chris@16: //! Chris@16: //!If the user only needs an alpha value near 1/sqrt(2), this Chris@16: //!option also improves performance since avoids logarithm Chris@16: //!and division operations when rebalancing the tree. Chris@16: template Chris@16: struct floating_point Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool floating_point = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the equality Chris@16: //!functor for the value type Chris@16: template Chris@16: struct equal Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef Equal equal; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the equality Chris@16: //!functor for the value type Chris@16: template Chris@16: struct priority Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef Priority priority; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the hash Chris@16: //!functor for the value type Chris@16: template Chris@16: struct hash Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef Hash hash; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the relationship between the type Chris@16: //!to be managed by the container (the value type) and the node to be Chris@16: //!used in the node algorithms. It also specifies the linking policy. Chris@16: template Chris@16: struct value_traits Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef ValueTraits proto_value_traits; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the member hook the Chris@16: //!container must use. Chris@16: template< typename Parent Chris@16: , typename MemberHook Chris@16: , MemberHook Parent::* PtrToMember> Chris@16: struct member_hook Chris@16: { Chris@16: /// @cond Chris@16: /* Chris@16: typedef typename MemberHook::hooktags::node_traits node_traits; Chris@16: typedef typename node_traits::node node_type; Chris@16: typedef node_type Parent::* Ptr2MemNode; Chris@16: typedef mhtraits Chris@16: < Parent Chris@16: , node_traits Chris@16: //This cast is really ugly but necessary to reduce template bloat. Chris@16: //Since we control the layout between the hook and the node, and there is Chris@16: //always single inheritance, the offset of the node is exactly the offset of Chris@16: //the hook. Since the node type is shared between all member hooks, this saves Chris@16: //quite a lot of symbol stuff. Chris@16: , (Ptr2MemNode)PtrToMember Chris@16: , MemberHook::hooktags::link_mode> member_value_traits; Chris@16: */ Chris@16: typedef mhtraits Chris@16: < Parent Chris@16: , MemberHook Chris@16: , PtrToMember Chris@16: > member_value_traits; Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef member_value_traits proto_value_traits; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: Chris@16: //!This option setter specifies the function object that will Chris@16: //!be used to convert between values to be inserted in a container Chris@16: //!and the hook to be used for that purpose. Chris@16: template< typename Functor> Chris@16: struct function_hook Chris@16: { Chris@16: /// @cond Chris@16: typedef fhtraits Chris@16: function_value_traits; Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef function_value_traits proto_value_traits; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: Chris@16: //!This option setter specifies that the container Chris@16: //!must use the specified base hook Chris@16: template Chris@16: struct base_hook Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef BaseHook proto_value_traits; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the type of Chris@16: //!a void pointer. This will instruct the hook Chris@16: //!to use this type of pointer instead of the Chris@16: //!default one Chris@16: template Chris@16: struct void_pointer Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef VoidPointer void_pointer; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the type of Chris@16: //!the tag of a base hook. A type cannot have two Chris@16: //!base hooks of the same type, so a tag can be used Chris@16: //!to differentiate two base hooks with otherwise same type Chris@16: template Chris@16: struct tag Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef Tag tag; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the link mode Chris@16: //!(normal_link, safe_link or auto_unlink) Chris@16: template Chris@16: struct link_mode Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const link_mode_type link_mode = LinkType; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the hook Chris@16: //!should be optimized for size instead of for speed. Chris@16: template Chris@16: struct optimize_size Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool optimize_size = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the list container should Chris@16: //!use a linear implementation instead of a circular one. Chris@16: template Chris@16: struct linear Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool linear = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the list container should Chris@16: //!use a linear implementation instead of a circular one. Chris@16: template Chris@16: struct cache_last Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool cache_last = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies the bucket traits Chris@16: //!class for unordered associative containers. When this option is specified, Chris@16: //!instead of using the default bucket traits, a user defined holder will be defined Chris@16: template Chris@16: struct bucket_traits Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: typedef BucketTraits bucket_traits; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the unordered hook Chris@16: //!should offer room to store the hash value. Chris@16: //!Storing the hash in the hook will speed up rehashing Chris@16: //!processes in applications where rehashing is frequent, Chris@16: //!rehashing might throw or the value is heavy to hash. Chris@16: template Chris@16: struct store_hash Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool store_hash = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the unordered hook Chris@16: //!should offer room to store another link to another node Chris@16: //!with the same key. Chris@16: //!Storing this link will speed up lookups and insertions on Chris@16: //!unordered_multiset containers with a great number of elements Chris@16: //!with the same key. Chris@16: template Chris@16: struct optimize_multikey Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool optimize_multikey = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the bucket array will be always power of two. Chris@16: //!This allows using masks instead of the default modulo operation to determine Chris@16: //!the bucket number from the hash value, leading to better performance. Chris@16: //!In debug mode, if power of two buckets mode is activated, the bucket length Chris@16: //!will be checked to through assertions to assure the bucket length is power of two. Chris@16: template Chris@16: struct power_2_buckets Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool power_2_buckets = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the container will cache a pointer to the first Chris@16: //!non-empty bucket so that begin() is always constant-time. Chris@16: //!This is specially helpful when we can have containers with a few elements Chris@16: //!but with big bucket arrays (that is, hashtables with low load factors). Chris@16: template Chris@16: struct cache_begin Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool cache_begin = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: Chris@16: //!This option setter specifies if the container will compare the hash value Chris@16: //!before comparing objects. This option can't be specified if store_hash<> Chris@16: //!is not true. Chris@16: //!This is specially helpful when we have containers with a high load factor. Chris@16: //!and the comparison function is much more expensive that comparing already Chris@16: //!stored hash values. Chris@16: template Chris@16: struct compare_hash Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool compare_hash = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: //!This option setter specifies if the hash container will use incremental Chris@16: //!hashing. With incremental hashing the cost of hash table expansion is spread Chris@16: //!out across each hash table insertion operation, as opposed to be incurred all at once. Chris@16: //!Therefore linear hashing is well suited for interactive applications or real-time Chris@16: //!appplications where the worst-case insertion time of non-incremental hash containers Chris@16: //!(rehashing the whole bucket array) is not admisible. Chris@16: template Chris@16: struct incremental Chris@16: { Chris@16: /// @cond Chris@16: template Chris@16: struct pack : Base Chris@16: { Chris@16: static const bool incremental = Enabled; Chris@16: }; Chris@16: /// @endcond Chris@16: }; Chris@16: Chris@16: /// @cond Chris@16: Chris@16: struct none Chris@16: { Chris@16: template Chris@16: struct pack : Base Chris@16: {}; Chris@16: }; Chris@16: Chris@16: //To-do: pass to variadic templates Chris@16: #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) Chris@16: Chris@16: template Chris@16: struct do_pack Chris@16: { Chris@16: //Use "pack" member template to pack options Chris@16: typedef typename Next::template pack type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct do_pack Chris@16: { Chris@16: //Avoid packing "void" to shorten template names Chris@16: typedef Prev type; Chris@16: }; Chris@16: Chris@16: template Chris@16: < class DefaultOptions Chris@16: , class O1 = void Chris@16: , class O2 = void Chris@16: , class O3 = void Chris@16: , class O4 = void Chris@16: , class O5 = void Chris@16: , class O6 = void Chris@16: , class O7 = void Chris@16: , class O8 = void Chris@16: , class O9 = void Chris@16: , class O10 = void Chris@16: , class O11 = void Chris@16: > Chris@16: struct pack_options Chris@16: { Chris@16: // join options Chris@16: typedef Chris@16: typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < typename do_pack Chris@16: < DefaultOptions Chris@16: , O1 Chris@16: >::type Chris@16: , O2 Chris@16: >::type Chris@16: , O3 Chris@16: >::type Chris@16: , O4 Chris@16: >::type Chris@16: , O5 Chris@16: >::type Chris@16: , O6 Chris@16: >::type Chris@16: , O7 Chris@16: >::type Chris@16: , O8 Chris@16: >::type Chris@16: , O9 Chris@16: >::type Chris@16: , O10 Chris@16: >::type Chris@16: , O11 Chris@16: >::type Chris@16: type; Chris@16: }; Chris@16: #else Chris@16: Chris@16: //index_tuple Chris@16: template Chris@16: struct index_tuple{}; Chris@16: Chris@16: //build_number_seq Chris@16: template > Chris@16: struct build_number_seq; Chris@16: Chris@16: template Chris@16: struct build_number_seq > Chris@16: : build_number_seq > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct build_number_seq<0, index_tuple > Chris@16: { typedef index_tuple type; }; Chris@16: Chris@16: template Chris@16: struct typelist Chris@16: {}; Chris@16: Chris@16: //invert_typelist Chris@16: template Chris@16: struct invert_typelist; Chris@16: Chris@16: template Chris@16: struct typelist_element; Chris@16: Chris@16: template Chris@16: struct typelist_element > Chris@16: { Chris@16: typedef typename typelist_element >::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct typelist_element<0, typelist > Chris@16: { Chris@16: typedef Head type; Chris@16: }; Chris@16: Chris@16: template Chris@16: typelist >::type...> Chris@16: inverted_typelist(index_tuple, typelist) Chris@16: { Chris@16: return typelist >::type...>(); Chris@16: } Chris@16: Chris@16: //sizeof_typelist Chris@16: template Chris@16: struct sizeof_typelist; Chris@16: Chris@16: template Chris@16: struct sizeof_typelist< typelist > Chris@16: { Chris@16: static const std::size_t value = sizeof...(Types); Chris@16: }; Chris@16: Chris@16: //invert_typelist_impl Chris@16: template Chris@16: struct invert_typelist_impl; Chris@16: Chris@16: Chris@16: template Chris@16: struct invert_typelist_impl< Typelist, index_tuple > Chris@16: { Chris@16: static const std::size_t last_idx = sizeof_typelist::value - 1; Chris@16: typedef typelist Chris@16: ::type...> type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct invert_typelist_impl< Typelist, index_tuple > Chris@16: { Chris@16: typedef Typelist type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct invert_typelist_impl< Typelist, index_tuple<> > Chris@16: { Chris@16: typedef Typelist type; Chris@16: }; Chris@16: Chris@16: //invert_typelist Chris@16: template Chris@16: struct invert_typelist; Chris@16: Chris@16: template Chris@16: struct invert_typelist< typelist > Chris@16: { Chris@16: typedef typelist typelist_t; Chris@16: typedef typename build_number_seq::type indexes_t; Chris@16: typedef typename invert_typelist_impl::type type; Chris@16: }; Chris@16: Chris@16: //Do pack Chris@16: template Chris@16: struct do_pack; Chris@16: Chris@16: template<> Chris@16: struct do_pack >; Chris@16: Chris@16: template Chris@16: struct do_pack > Chris@16: { Chris@16: typedef Prev type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct do_pack > Chris@16: { Chris@16: typedef typename Prev::template pack type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct do_pack > Chris@16: { Chris@16: typedef typename Prev::template pack Chris@16: >::type> type; Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: struct pack_options Chris@16: { Chris@16: typedef typelist typelist_t; Chris@16: typedef typename invert_typelist::type inverted_typelist; Chris@16: typedef typename do_pack::type type; Chris@16: }; Chris@16: Chris@16: #endif Chris@16: Chris@16: struct hook_defaults Chris@16: { Chris@16: typedef void* void_pointer; Chris@16: static const link_mode_type link_mode = safe_link; Chris@16: typedef default_tag tag; Chris@16: static const bool optimize_size = false; Chris@16: static const bool store_hash = false; Chris@16: static const bool linear = false; Chris@16: static const bool optimize_multikey = false; Chris@16: }; Chris@16: Chris@16: /// @endcond Chris@16: Chris@16: } //namespace intrusive { Chris@16: } //namespace boost { Chris@16: Chris@16: #include Chris@16: Chris@16: #endif //#ifndef BOOST_INTRUSIVE_OPTIONS_HPP