types_traits.hpp (store_extra_false_type): To false_type.

2006-09-30  Benjamin Kosnik  <bkoz@redhat.com>

	* include/ext/pb_ds/detail/types_traits.hpp (store_extra_false_type):
	To false_type.
	(store_extra_true_type): To true_type.
	(no_throw_copies_true_type): To true_type.
	(no_throw_copies_false_type): To false_type.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	insert_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	resize_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	insert_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	entry_list_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	debug_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	debug_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	resize_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	insert_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	resize_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	insert_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	find_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	debug_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	debug_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	resize_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Same.

From-SVN: r117329
This commit is contained in:
Benjamin Kosnik 2006-09-30 10:25:12 +00:00 committed by Benjamin Kosnik
parent beb5d0f44c
commit 10d2ebc511
19 changed files with 83 additions and 62 deletions

View File

@ -1,3 +1,42 @@
2006-09-30 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/pb_ds/detail/types_traits.hpp (store_extra_false_type):
To false_type.
(store_extra_true_type): To true_type.
(no_throw_copies_true_type): To true_type.
(no_throw_copies_false_type): To false_type.
* include/ext/pb_ds/detail/cc_hash_table_map_/
insert_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
resize_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
insert_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
entry_list_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
debug_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
debug_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
resize_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
insert_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
resize_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
insert_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
find_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
debug_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
debug_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
resize_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Same.
2006-09-29 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/pb_ds/detail/cc_hash_table_map_/
@ -5,7 +44,7 @@
* include/ext/pb_ds/detail/basic_tree_policy/
null_node_metadata.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Same.
-- * include/ext/pb_ds/detail/basic_types.hpp: Same.
* include/ext/pb_ds/detail/basic_types.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/
mtf_lu_policy_imp.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/

View File

@ -136,10 +136,6 @@ namespace pb_ds
typedef typename traits_base::const_pointer const_pointer_;
typedef typename traits_base::reference reference_;
typedef typename traits_base::const_reference const_reference_;
typedef typename traits_base::store_extra_false_type store_hash_false_type;
typedef typename traits_base::store_extra_true_type store_hash_true_type;
typedef typename traits_base::no_throw_copies_false_type no_throw_copies_false_type;
typedef typename traits_base::no_throw_copies_true_type no_throw_copies_true_type;
struct entry : public traits_base::stored_value_type
{
@ -362,26 +358,26 @@ namespace pb_ds
resize_imp_no_exceptions(size_type, entry_pointer_array, size_type);
inline entry_pointer
resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, store_hash_false_type);
resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, false_type);
inline entry_pointer
resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, store_hash_true_type);
resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, true_type);
void
deallocate_links_in_list(entry_pointer);
inline entry_pointer
get_entry(const_reference, no_throw_copies_false_type);
get_entry(const_reference, false_type);
inline entry_pointer
get_entry(const_reference, no_throw_copies_true_type);
get_entry(const_reference, true_type);
inline void
rels_entry(entry_pointer);
#ifdef PB_DS_DATA_TRUE_INDICATOR
inline mapped_reference
subscript_imp(const_key_reference r_key, store_hash_false_type)
subscript_imp(const_key_reference r_key, false_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
const size_type pos = ranged_hash_fn_base::operator()(r_key);
@ -407,7 +403,7 @@ namespace pb_ds
}
inline mapped_reference
subscript_imp(const_key_reference r_key, store_hash_true_type)
subscript_imp(const_key_reference r_key, true_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
@ -434,10 +430,10 @@ namespace pb_ds
#endif
inline std::pair<point_iterator, bool>
insert_imp(const_reference, store_hash_false_type);
insert_imp(const_reference, false_type);
inline std::pair<point_iterator, bool>
insert_imp(const_reference, store_hash_true_type);
insert_imp(const_reference, true_type);
inline pointer
insert_new_imp(const_reference r_val, size_type pos)
@ -478,7 +474,7 @@ namespace pb_ds
}
inline pointer
find_key_pointer(const_key_reference r_key, store_hash_false_type)
find_key_pointer(const_key_reference r_key, false_type)
{
entry_pointer p_e = m_entries[ranged_hash_fn_base::operator()(r_key)];
resize_base::notify_find_search_start();
@ -501,7 +497,7 @@ namespace pb_ds
}
inline pointer
find_key_pointer(const_key_reference r_key, store_hash_true_type)
find_key_pointer(const_key_reference r_key, true_type)
{
comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
entry_pointer p_e = m_entries[pos_hash_pair.first];
@ -585,17 +581,15 @@ namespace pb_ds
assert_entry_pointer_array_valid(const entry_pointer_array) const;
void
assert_entry_pointer_valid(const entry_pointer,
store_hash_true_type) const;
assert_entry_pointer_valid(const entry_pointer, true_type) const;
void
assert_entry_pointer_valid(const entry_pointer,
store_hash_false_type) const;
assert_entry_pointer_valid(const entry_pointer, false_type) const;
#endif
#ifdef PB_DS_HT_MAP_TRACE_
void
trace_list(const_entry_pointer p_l) const;
trace_list(const_entry_pointer) const;
#endif
private:

View File

@ -49,7 +49,7 @@
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
assert_entry_pointer_valid(const entry_pointer p, store_hash_false_type) const
assert_entry_pointer_valid(const entry_pointer p, false_type) const
{ map_debug_base::check_key_exists(PB_DS_V2F(p->m_value)); }
#endif

View File

@ -49,7 +49,7 @@
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
assert_entry_pointer_valid(const entry_pointer p_e, store_hash_true_type) const
assert_entry_pointer_valid(const entry_pointer p_e, true_type) const
{
map_debug_base::check_key_exists(PB_DS_V2F(p_e->m_value));
comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));

View File

@ -60,7 +60,7 @@ deallocate_links_in_list(entry_pointer p_e)
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::entry_pointer
PB_DS_CLASS_C_DEC::
get_entry(const_reference r_val, no_throw_copies_true_type)
get_entry(const_reference r_val, true_type)
{
// Following line might throw an exception.
entry_pointer p_e = s_entry_allocator.allocate(1);
@ -73,7 +73,7 @@ get_entry(const_reference r_val, no_throw_copies_true_type)
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::entry_pointer
PB_DS_CLASS_C_DEC::
get_entry(const_reference r_val, no_throw_copies_false_type)
get_entry(const_reference r_val, false_type)
{
// Following line might throw an exception.
entry_pointer p_e = s_entry_allocator.allocate(1);

View File

@ -48,7 +48,7 @@
PB_DS_CLASS_T_DEC
inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
PB_DS_CLASS_C_DEC::
insert_imp(const_reference r_val, store_hash_false_type)
insert_imp(const_reference r_val, false_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
const_key_reference r_key = PB_DS_V2F(r_val);

View File

@ -48,7 +48,7 @@
PB_DS_CLASS_T_DEC
inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
PB_DS_CLASS_C_DEC::
insert_imp(const_reference r_val, store_hash_true_type)
insert_imp(const_reference r_val, true_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
const_key_reference key = PB_DS_V2F(r_val);

View File

@ -48,7 +48,7 @@
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::entry_pointer
PB_DS_CLASS_C_DEC::
resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, store_hash_false_type)
resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, false_type)
{
const size_type hash_pos =
ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));

View File

@ -48,7 +48,7 @@
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::entry_pointer
PB_DS_CLASS_C_DEC::
resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, store_hash_true_type)
resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, true_type)
{
const comp_hash pos_hash_pair =
ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash);

View File

@ -49,7 +49,7 @@
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
assert_entry_array_valid(const entry_array a_entries, store_hash_false_type) const
assert_entry_array_valid(const entry_array a_entries, false_type) const
{
size_type iterated_num_used_e = 0;
for (size_type pos = 0; pos < m_num_e; ++pos)

View File

@ -49,7 +49,7 @@
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
assert_entry_array_valid(const entry_array a_entries, store_hash_true_type) const
assert_entry_array_valid(const entry_array a_entries, true_type) const
{
size_type iterated_num_used_e = 0;

View File

@ -48,5 +48,5 @@
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::pointer
PB_DS_CLASS_C_DEC::
find_key_pointer(const_key_reference r_key, store_hash_false_type)
find_key_pointer(const_key_reference r_key, false_type)

View File

@ -127,8 +127,6 @@ namespace pb_ds
{
private:
typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
typedef typename traits_base::store_extra_false_type store_hash_false_type;
typedef typename traits_base::store_extra_true_type store_hash_true_type;
typedef typename traits_base::value_type value_type_;
typedef typename traits_base::pointer pointer_;
typedef typename traits_base::const_pointer const_pointer_;
@ -383,22 +381,22 @@ namespace pb_ds
resize_imp(entry_array, size_type);
inline void
resize_imp_reassign(entry_pointer, entry_array, store_hash_false_type);
resize_imp_reassign(entry_pointer, entry_array, false_type);
inline void
resize_imp_reassign(entry_pointer, entry_array, store_hash_true_type);
resize_imp_reassign(entry_pointer, entry_array, true_type);
inline size_type
find_ins_pos(const_key_reference, store_hash_false_type);
find_ins_pos(const_key_reference, false_type);
inline comp_hash
find_ins_pos(const_key_reference, store_hash_true_type);
find_ins_pos(const_key_reference, true_type);
inline std::pair<point_iterator, bool>
insert_imp(const_reference, store_hash_false_type);
insert_imp(const_reference, false_type);
inline std::pair<point_iterator, bool>
insert_imp(const_reference, store_hash_true_type);
insert_imp(const_reference, true_type);
inline pointer
insert_new_imp(const_reference r_val, size_type pos)
@ -450,7 +448,7 @@ namespace pb_ds
#ifdef PB_DS_DATA_TRUE_INDICATOR
inline mapped_reference
subscript_imp(const_key_reference key, store_hash_false_type)
subscript_imp(const_key_reference key, false_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
@ -466,7 +464,7 @@ namespace pb_ds
}
inline mapped_reference
subscript_imp(const_key_reference key, store_hash_true_type)
subscript_imp(const_key_reference key, true_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
@ -483,7 +481,7 @@ namespace pb_ds
#endif
inline pointer
find_key_pointer(const_key_reference key, store_hash_false_type)
find_key_pointer(const_key_reference key, false_type)
{
const size_type hash = ranged_probe_fn_base::operator()(key);
size_type i;
@ -529,7 +527,7 @@ namespace pb_ds
}
inline pointer
find_key_pointer(const_key_reference key, store_hash_true_type)
find_key_pointer(const_key_reference key, true_type)
{
comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(key);
size_type i;
@ -640,10 +638,10 @@ namespace pb_ds
#ifdef _GLIBCXX_DEBUG
void
assert_entry_array_valid(const entry_array, store_hash_false_type) const;
assert_entry_array_valid(const entry_array, false_type) const;
void
assert_entry_array_valid(const entry_array, store_hash_true_type) const;
assert_entry_array_valid(const entry_array, true_type) const;
#endif
static entry_allocator s_entry_allocator;

View File

@ -48,7 +48,7 @@
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
find_ins_pos(const_key_reference r_key, store_hash_false_type)
find_ins_pos(const_key_reference r_key, false_type)
{
size_type hash = ranged_probe_fn_base::operator()(r_key);
size_type i;
@ -99,7 +99,7 @@ find_ins_pos(const_key_reference r_key, store_hash_false_type)
PB_DS_CLASS_T_DEC
inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
PB_DS_CLASS_C_DEC::
insert_imp(const_reference r_val, store_hash_false_type)
insert_imp(const_reference r_val, false_type)
{
const_key_reference r_key = PB_DS_V2F(r_val);
const size_type pos = find_ins_pos(r_key,

View File

@ -48,7 +48,7 @@
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::comp_hash
PB_DS_CLASS_C_DEC::
find_ins_pos(const_key_reference r_key, store_hash_true_type)
find_ins_pos(const_key_reference r_key, true_type)
{
_GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
@ -104,7 +104,7 @@ find_ins_pos(const_key_reference r_key, store_hash_true_type)
PB_DS_CLASS_T_DEC
inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
PB_DS_CLASS_C_DEC::
insert_imp(const_reference r_val, store_hash_true_type)
insert_imp(const_reference r_val, true_type)
{
const_key_reference r_key = PB_DS_V2F(r_val);
comp_hash pos_hash_pair = find_ins_pos(r_key,

View File

@ -49,7 +49,7 @@ PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
resize_imp_reassign(entry_pointer p_e, entry_array a_entries_resized,
store_hash_false_type)
false_type)
{
const_key_reference r_key = PB_DS_V2F(p_e->m_value);
size_type hash = ranged_probe_fn_base::operator()(r_key);

View File

@ -49,7 +49,7 @@ PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
resize_imp_reassign(entry_pointer p_e, entry_array a_entries_resized,
store_hash_true_type)
true_type)
{
const_key_reference r_key = PB_DS_V2F(p_e->m_value);
size_type hash = ranged_probe_fn_base::operator()(r_key, p_e->m_hash);

View File

@ -63,7 +63,6 @@ namespace pb_ds
{
namespace detail
{
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Mapped, class Eq_Fn, \
class Allocator, class Update_Policy>
@ -152,10 +151,6 @@ namespace pb_ds
typedef PB_DS_MAP_DEBUG_BASE_C_DEC map_debug_base;
#endif
typedef typename traits_base:: no_throw_copies_false_type no_throw_copies_false_type;
typedef typename traits_base:: no_throw_copies_true_type no_throw_copies_true_type;
typedef cond_dealtor<entry, Allocator> cond_dealtor_t;
public:

View File

@ -73,10 +73,6 @@ namespace pb_ds
typedef typename key_allocator::reference key_reference;
typedef typename key_allocator::const_reference const_key_reference;
typedef typename Alloc::size_type size_type;
typedef false_type store_extra_false_type;
typedef true_type store_extra_true_type;
typedef false_type no_throw_copies_false_type;
typedef true_type no_throw_copies_true_type;
integral_constant<int, Store_Extra> m_store_extra_indicator;
typename no_throw_copies<Key, Mapped>::indicator m_no_throw_copies_indicator;
@ -84,8 +80,7 @@ namespace pb_ds
// Extra value (used when the extra value is stored with each value).
typedef typename comp_hash_<size_type>::comp_hash comp_hash;
};
} // namespace detail
} // namespace pb_ds
#endif // #ifndef PB_DS_TYPES_TRAITS_HPP
#endif