mirror of
https://github.com/boostorg/intrusive.git
synced 2025-10-18 10:55:18 +02:00
Intrusive:
* Added `linear<>` and `cache_last<>` options to singly linked lists. * Added `optimize_multikey<>` option to unordered container hooks. * Optimized unordered containers when `store_hash` option is used in the hook. * Implementation changed to be exception agnostic so that it can be used in environments without exceptions. * Added `container_from_iterator` function to tree-based containers. Interprocess: * Added anonymous shared memory for UNIX systems. * Fixed file lock compilation errors [SVN r44819]
This commit is contained in:
@@ -26,7 +26,7 @@ using namespace boost::intrusive;
|
||||
|
||||
static const std::size_t BucketSize = 11;
|
||||
|
||||
template<class ValueTraits>
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
struct test_unordered_set
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
@@ -40,14 +40,15 @@ struct test_unordered_set
|
||||
static void test_clone(std::vector<value_type>& values);
|
||||
};
|
||||
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_all(std::vector<typename ValueTraits::value_type>& values)
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_all(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
{
|
||||
@@ -75,14 +76,15 @@ void test_unordered_set<ValueTraits>::test_all(std::vector<typename ValueTraits:
|
||||
}
|
||||
|
||||
//test case due to an error in tree implementation:
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_impl()
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_impl()
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
|
||||
@@ -103,14 +105,15 @@ void test_unordered_set<ValueTraits>::test_impl()
|
||||
}
|
||||
|
||||
//test: constructor, iterator, clear, reverse_iterator, front, back, size:
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_sort(std::vector<typename ValueTraits::value_type>& values)
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_sort(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
|
||||
@@ -126,14 +129,15 @@ void test_unordered_set<ValueTraits>::test_sort(std::vector<typename ValueTraits
|
||||
}
|
||||
|
||||
//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_insert(std::vector<typename ValueTraits::value_type>& values)
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_insert(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
|
||||
@@ -161,14 +165,15 @@ void test_unordered_set<ValueTraits>::test_insert(std::vector<typename ValueTrai
|
||||
}
|
||||
|
||||
//test: insert (seq-version), swap, erase (seq-version), size:
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_swap(std::vector<typename ValueTraits::value_type>& values)
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_swap(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
|
||||
@@ -192,14 +197,15 @@ void test_unordered_set<ValueTraits>::test_swap(std::vector<typename ValueTraits
|
||||
}
|
||||
|
||||
//test: rehash:
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_rehash(std::vector<typename ValueTraits::value_type>& values)
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_rehash(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
|
||||
@@ -237,14 +243,15 @@ void test_unordered_set<ValueTraits>::test_rehash(std::vector<typename ValueTrai
|
||||
|
||||
|
||||
//test: find, equal_range (lower_bound, upper_bound):
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>::test_find(std::vector<typename ValueTraits::value_type>& values)
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>::test_find(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
typedef unordered_set
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
|
||||
@@ -267,8 +274,8 @@ void test_unordered_set<ValueTraits>::test_find(std::vector<typename ValueTraits
|
||||
BOOST_TEST (testset.find (cmp_val) == testset.end());
|
||||
}
|
||||
|
||||
template<class ValueTraits>
|
||||
void test_unordered_set<ValueTraits>
|
||||
template<class ValueTraits, bool CacheBegin>
|
||||
void test_unordered_set<ValueTraits, CacheBegin>
|
||||
::test_clone(std::vector<typename ValueTraits::value_type>& values)
|
||||
{
|
||||
typedef typename ValueTraits::value_type value_type;
|
||||
@@ -276,6 +283,7 @@ void test_unordered_set<ValueTraits>
|
||||
<value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<value_type::constant_time_size>
|
||||
, cache_begin<CacheBegin>
|
||||
> unordered_set_type;
|
||||
typedef typename unordered_set_type::bucket_traits bucket_traits;
|
||||
{
|
||||
@@ -347,6 +355,7 @@ class test_main_template
|
||||
< value_type
|
||||
, typename value_type::unordered_set_base_hook_t
|
||||
>::type
|
||||
, true
|
||||
>::test_all(data);
|
||||
test_unordered_set < typename detail::get_member_value_traits
|
||||
< value_type
|
||||
@@ -355,6 +364,7 @@ class test_main_template
|
||||
, &value_type::unordered_set_node_
|
||||
>
|
||||
>::type
|
||||
, false
|
||||
>::test_all(data);
|
||||
|
||||
return 0;
|
||||
@@ -377,6 +387,7 @@ class test_main_template<VoidPointer, false>
|
||||
< value_type
|
||||
, typename value_type::unordered_set_base_hook_t
|
||||
>::type
|
||||
, true
|
||||
>::test_all(data);
|
||||
|
||||
test_unordered_set < typename detail::get_member_value_traits
|
||||
@@ -386,12 +397,14 @@ class test_main_template<VoidPointer, false>
|
||||
, &value_type::unordered_set_node_
|
||||
>
|
||||
>::type
|
||||
, false
|
||||
>::test_all(data);
|
||||
|
||||
test_unordered_set < typename detail::get_base_value_traits
|
||||
< value_type
|
||||
, typename value_type::unordered_set_auto_base_hook_t
|
||||
>::type
|
||||
, true
|
||||
>::test_all(data);
|
||||
|
||||
test_unordered_set < typename detail::get_member_value_traits
|
||||
@@ -401,6 +414,7 @@ class test_main_template<VoidPointer, false>
|
||||
, &value_type::unordered_set_auto_node_
|
||||
>
|
||||
>::type
|
||||
, false
|
||||
>::test_all(data);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user