X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=boost%2Fintrusive%2Funordered_set_hook.hpp;h=7406c9428dbbac2c9a8717591b5c5638e854b1e7;hb=08c1e93fa36a49f49325a07fe91ff92c964c2b6c;hp=c7e95b222c748906567e5112f46ce24d962380de;hpb=bb4dd8289b351fae6b55e303f189127a394a1edd;p=platform%2Fupstream%2Fboost.git diff --git a/boost/intrusive/unordered_set_hook.hpp b/boost/intrusive/unordered_set_hook.hpp index c7e95b2..7406c94 100644 --- a/boost/intrusive/unordered_set_hook.hpp +++ b/boost/intrusive/unordered_set_hook.hpp @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // // (C) Copyright Olaf Krzikalla 2004-2006. -// (C) Copyright Ion Gaztanaga 2006-2012 +// (C) Copyright Ion Gaztanaga 2006-2013 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at @@ -14,14 +14,16 @@ #ifndef BOOST_INTRUSIVE_UNORDERED_SET_HOOK_HPP #define BOOST_INTRUSIVE_UNORDERED_SET_HOOK_HPP +#if defined(_MSC_VER) +# pragma once +#endif + #include #include -#include -#include + #include #include #include -#include #include namespace boost { @@ -81,9 +83,7 @@ struct unordered_node_traits static const bool optimize_multikey = OptimizeMultiKey; static node_ptr get_next(const const_node_ptr & n) - { - return pointer_traits::pointer_to(static_cast(*n->next_)); - } + { return pointer_traits::static_cast_from(n->next_); } static void set_next(const node_ptr & n, const node_ptr & next) { n->next_ = next; } @@ -120,8 +120,12 @@ struct unordered_algorithms : public circular_slist_algorithms { typedef circular_slist_algorithms base_type; - typedef unordered_group_adapter group_traits; + typedef unordered_group_adapter group_traits; typedef circular_slist_algorithms group_algorithms; + typedef NodeTraits node_traits; + typedef typename NodeTraits::node node; + typedef typename NodeTraits::node_ptr node_ptr; + typedef typename NodeTraits::const_node_ptr const_node_ptr; static void init(typename base_type::node_ptr n) { @@ -142,6 +146,11 @@ struct unordered_algorithms } }; +//Class to avoid defining the same algo as a circular list, as hooks would be ambiguous between them +template +struct uset_algo_wrapper : public Algo +{}; + template struct get_uset_node_algo { @@ -151,9 +160,9 @@ struct get_uset_node_algo , slist_node_traits >::type node_traits_type; typedef typename detail::if_c - < OptimizeMultiKey - , unordered_algorithms - , circular_slist_algorithms + < OptimizeMultiKey + , unordered_algorithms + , uset_algo_wrapper< circular_slist_algorithms > >::type type; }; /// @endcond @@ -163,7 +172,7 @@ struct get_uset_node_algo #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) template #else -template +template #endif struct make_unordered_set_base_hook { @@ -177,14 +186,14 @@ struct make_unordered_set_base_hook #endif >::type packed_options; - typedef detail::generic_hook - < get_uset_node_algo + typedef generic_hook + < typename get_uset_node_algo < typename packed_options::void_pointer + , packed_options::store_hash + , packed_options::optimize_multikey + >::type , typename packed_options::tag , packed_options::link_mode - , detail::UsetBaseHook + , HashBaseHookId > implementation_defined; /// @endcond typedef implementation_defined type; @@ -203,7 +212,7 @@ struct make_unordered_set_base_hook //! unique tag. //! //! \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. //! //! \c link_mode<> will specify the linking mode of the hook (\c normal_link, //! \c auto_unlink or \c safe_link). @@ -302,7 +311,7 @@ class unordered_set_base_hook #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES) template #else -template +template #endif struct make_unordered_set_member_hook { @@ -316,14 +325,14 @@ struct make_unordered_set_member_hook #endif >::type packed_options; - typedef detail::generic_hook - < get_uset_node_algo< typename packed_options::void_pointer - , packed_options::store_hash - , packed_options::optimize_multikey - > + typedef generic_hook + < typename get_uset_node_algo< typename packed_options::void_pointer + , packed_options::store_hash + , packed_options::optimize_multikey + >::type , member_tag , packed_options::link_mode - , detail::NoBaseHook + , NoBaseHookId > implementation_defined; /// @endcond typedef implementation_defined type; @@ -337,7 +346,7 @@ struct make_unordered_set_member_hook //! \c link_mode<> and \c store_hash<>. //! //! \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. //! //! \c link_mode<> will specify the linking mode of the hook (\c normal_link, //! \c auto_unlink or \c safe_link).