CPP-Boost-Mini
view release on metacpan or search on metacpan
include/boost/intrusive/detail/generic_hook.hpp view on Meta::CPAN
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/intrusive for documentation.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_GENERIC_HOOK_HPP
#define BOOST_INTRUSIVE_GENERIC_HOOK_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/detail/assert.hpp>
#include <boost/intrusive/detail/node_holder.hpp>
#include <boost/intrusive/detail/algo_type.hpp>
#include <boost/static_assert.hpp>
namespace boost {
namespace intrusive {
/// @cond
namespace detail {
template <link_mode_type LinkMode>
struct link_dispatch
{};
template<class Hook>
void destructor_impl(Hook &hook, detail::link_dispatch<safe_link>)
{ //If this assertion raises, you might have destroyed an object
//while it was still inserted in a container that is alive.
//If so, remove the object from the container before destroying it.
(void)hook; BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT(!hook.is_linked());
}
template<class Hook>
void destructor_impl(Hook &hook, detail::link_dispatch<auto_unlink>)
{ hook.unlink(); }
template<class Hook>
void destructor_impl(Hook &, detail::link_dispatch<normal_link>)
{}
} //namespace detail {
enum base_hook_type
{ NoBaseHookId
, ListBaseHookId
, SlistBaseHookId
, RbTreeBaseHookId
, HashBaseHookId
, AvlTreeBaseHookId
, BsTreeBaseHookId
, TreapTreeBaseHookId
, AnyBaseHookId
};
template <class HookTags, unsigned int>
struct hook_tags_definer{};
template <class HookTags>
struct hook_tags_definer<HookTags, ListBaseHookId>
{ typedef HookTags default_list_hook; };
template <class HookTags>
struct hook_tags_definer<HookTags, SlistBaseHookId>
{ typedef HookTags default_slist_hook; };
template <class HookTags>
struct hook_tags_definer<HookTags, RbTreeBaseHookId>
{ typedef HookTags default_rbtree_hook; };
template <class HookTags>
struct hook_tags_definer<HookTags, HashBaseHookId>
{ typedef HookTags default_hashtable_hook; };
template <class HookTags>
struct hook_tags_definer<HookTags, AvlTreeBaseHookId>
{ typedef HookTags default_avltree_hook; };
template <class HookTags>
struct hook_tags_definer<HookTags, BsTreeBaseHookId>
{ typedef HookTags default_bstree_hook; };
template <class HookTags>
struct hook_tags_definer<HookTags, AnyBaseHookId>
{ typedef HookTags default_any_hook; };
template
< class NodeTraits
( run in 0.768 second using v1.01-cache-2.11-cpan-df04353d9ac )