forked from boostorg/intrusive
Refactored tests to minimize instantiations and improve compilation times/memory for tests
This commit is contained in:
@ -42,8 +42,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -59,6 +69,16 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< avl_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -69,6 +89,16 @@ class test_main_template
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< avl_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_multiset
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -100,30 +130,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
//test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, true>::execute();
|
||||
//test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, true>::execute();
|
||||
//test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, true>::execute();
|
||||
//test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -42,8 +42,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -59,6 +69,16 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< avl_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -69,6 +89,16 @@ class test_main_template
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< avl_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_set
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -100,24 +130,24 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
//test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define BOOST_INTRUSIVE_BPTR_VALUE_HPP
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include "bounded_pointer.hpp"
|
||||
#include "common_functors.hpp"
|
||||
|
||||
@ -104,6 +105,9 @@ struct BPtr_Value
|
||||
|
||||
}; // class BPtr_Value
|
||||
|
||||
std::ostream& operator<<(std::ostream& s, const BPtr_Value& t)
|
||||
{ return s << t.value_.int_value(); }
|
||||
|
||||
template < typename Node_Algorithms >
|
||||
void swap_nodes(bounded_reference< BPtr_Value > lhs, bounded_reference< BPtr_Value > rhs)
|
||||
{
|
||||
|
@ -41,8 +41,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -58,6 +68,16 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -68,6 +88,17 @@ class test_main_template
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_multiset
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -99,29 +130,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
//test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, true>::execute();
|
||||
//test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, true>::execute();
|
||||
//test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, true>::execute();
|
||||
//test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
|
@ -41,8 +41,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -58,6 +68,16 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -68,6 +88,16 @@ class test_main_template
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_set
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -99,30 +129,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
//test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -127,6 +127,7 @@ void test_iterator_compatible(C &c)
|
||||
const_iterator ci;
|
||||
iterator i(c.begin());
|
||||
ci = i;
|
||||
(void)ci;
|
||||
BOOST_ASSERT(ci == i);
|
||||
BOOST_ASSERT(*ci == *i);
|
||||
const_iterator ci2(i);
|
||||
@ -204,11 +205,9 @@ void test_iterator_forward_functions(C const &c, I const b, I const e)
|
||||
for(I it2 = b; i != c.size(); ++it, ++i){
|
||||
BOOST_TEST(it == it2++);
|
||||
I ittmp(it);
|
||||
BOOST_TEST(&++ittmp == &ittmp);
|
||||
I *iaddr = &ittmp;
|
||||
BOOST_TEST(&(++ittmp) == iaddr);
|
||||
BOOST_TEST(ittmp == it2);
|
||||
if(it2 != e){
|
||||
BOOST_TEST(*ittmp == *it2);
|
||||
}
|
||||
}
|
||||
BOOST_TEST(i == c.size());
|
||||
BOOST_TEST(it == e);
|
||||
@ -235,12 +234,10 @@ void test_iterator_bidirectional_functions(C const &c, I const b, I const e)
|
||||
for(I it2 = e; i != c.size(); --it, ++i){
|
||||
BOOST_TEST(it == it2--);
|
||||
I ittmp(it);
|
||||
BOOST_TEST(&--ittmp == &ittmp);
|
||||
I*iaddr = &ittmp;
|
||||
BOOST_TEST(&(--ittmp) == iaddr);
|
||||
BOOST_TEST(ittmp == it2);
|
||||
BOOST_TEST(++ittmp == it);
|
||||
if(it != e){
|
||||
BOOST_TEST(*ittmp == *it);
|
||||
}
|
||||
BOOST_TEST((++ittmp) == it);
|
||||
}
|
||||
BOOST_TEST(i == c.size());
|
||||
BOOST_TEST(it == b);
|
||||
|
@ -156,7 +156,7 @@ void swap_nodes(testvalue<Hooks>& lhs, testvalue<Hooks>& rhs)
|
||||
template<class Hooks>
|
||||
std::ostream& operator<<
|
||||
(std::ostream& s, const testvalue<Hooks>& t)
|
||||
{ return s << t.value_; }
|
||||
{ return s << t.value_.int_value(); }
|
||||
|
||||
struct even_odd
|
||||
{
|
||||
|
@ -41,9 +41,18 @@ struct rebinder
|
||||
BOOST_STATIC_ASSERT((key_type_tester<typename common_t::key_of_value_opt, type>::value));
|
||||
};
|
||||
};
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -59,6 +68,16 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< rb_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -69,6 +88,16 @@ class test_main_template
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< rb_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_multiset
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -100,30 +129,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
//test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, true>::execute();
|
||||
//test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, true>::execute();
|
||||
//test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, true>::execute();
|
||||
//test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -42,8 +42,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -59,6 +69,16 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< rb_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -69,6 +89,16 @@ class test_main_template
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< rb_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_set
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -100,24 +130,24 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
//test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
|
@ -41,8 +41,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, FloatingPoint, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -54,12 +64,32 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, FloatingPoint, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, FloatingPoint, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename testval_traits_t::member_value_traits member_hook_t;
|
||||
test::test_generic_multiset
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, FloatingPoint, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, FloatingPoint, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_multiset
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -68,6 +98,7 @@ class test_main_template
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template < bool FloatingPoint, bool Map >
|
||||
struct test_main_template_bptr
|
||||
{
|
||||
@ -91,30 +122,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
//test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, true>::execute();
|
||||
//test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, true>::execute();
|
||||
//test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, true>::execute();
|
||||
//test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool FloatingPoint, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -41,8 +41,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, FloatingPoint, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -54,12 +64,32 @@ class test_main_template
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, FloatingPoint, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, FloatingPoint, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename testval_traits_t::member_value_traits member_hook_t;
|
||||
test::test_generic_set
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, FloatingPoint, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool FloatingPoint, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, FloatingPoint, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_set
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -91,24 +121,24 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
//test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool FloatingPoint, bool Map)
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
|
@ -127,6 +127,12 @@ class smart_ptr
|
||||
: m_ptr(ptr.m_ptr)
|
||||
{}
|
||||
|
||||
pointer get() const
|
||||
{ return m_ptr; }
|
||||
|
||||
void set(pointer p)
|
||||
{ m_ptr = p; }
|
||||
|
||||
//!Pointer-like -> operator. It can return 0 pointer. Never throws.
|
||||
pointer operator->() const
|
||||
{ return m_ptr; }
|
||||
@ -276,25 +282,26 @@ struct pointer_plus_bits<smart_ptr<T>, NumBits>
|
||||
|
||||
static pointer get_pointer(const pointer &n)
|
||||
{
|
||||
return pointer_traits<pointer>::pointer_to
|
||||
(*pointer_plus_bits<T*, NumBits>::get_pointer(n.operator->()));
|
||||
pointer p;
|
||||
p.set(pointer_plus_bits<T*, NumBits>::get_pointer(n.get()));
|
||||
return p;
|
||||
}
|
||||
|
||||
static void set_pointer(pointer &n, pointer p)
|
||||
{
|
||||
T *raw_n = n.operator->();
|
||||
T *raw_n = n.get();
|
||||
pointer_plus_bits<T*, NumBits>::set_pointer(raw_n, p.operator->());
|
||||
n = pointer_traits<pointer>::pointer_to(*raw_n);
|
||||
n.set(raw_n);
|
||||
}
|
||||
|
||||
static std::size_t get_bits(const pointer &n)
|
||||
{ return pointer_plus_bits<T*, NumBits>::get_bits(n.operator->()); }
|
||||
{ return pointer_plus_bits<T*, NumBits>::get_bits(n.get()); }
|
||||
|
||||
static void set_bits(pointer &n, std::size_t c)
|
||||
{
|
||||
T *raw_n = n.operator->();
|
||||
pointer_plus_bits<T*, NumBits>::set_bits(raw_n, c);
|
||||
n = pointer_traits<pointer>::pointer_to(*raw_n);
|
||||
n.set(raw_n);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -41,25 +41,63 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//base
|
||||
typedef typename testval_traits_t::base_value_traits base_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::base_value_traits
|
||||
, typename testval_traits_t::auto_base_value_traits
|
||||
>::type base_hook_t;
|
||||
test::test_generic_multiset
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename testval_traits_t::member_value_traits member_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::member_value_traits
|
||||
, typename testval_traits_t::auto_member_value_traits
|
||||
>::type member_hook_t;
|
||||
test::test_generic_multiset
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_multiset
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -91,30 +129,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
//test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, true>::execute();
|
||||
//test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, true>::execute();
|
||||
//test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, true>::execute();
|
||||
//test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -41,25 +41,63 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//base
|
||||
typedef typename testval_traits_t::base_value_traits base_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::base_value_traits
|
||||
, typename testval_traits_t::auto_base_value_traits
|
||||
>::type base_hook_t;
|
||||
test::test_generic_set
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename testval_traits_t::member_value_traits member_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::member_value_traits
|
||||
, typename testval_traits_t::auto_member_value_traits
|
||||
>::type member_hook_t;
|
||||
test::test_generic_set
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_set
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -91,24 +129,24 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
//test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
|
@ -9,7 +9,7 @@
|
||||
// See http://www.boost.org/libs/intrusive for documentation.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/intrusive/sg_set.hpp>
|
||||
#include <boost/intrusive/treap_set.hpp>
|
||||
#include "itestvalue.hpp"
|
||||
#include "bptr_value.hpp"
|
||||
#include "smart_ptr.hpp"
|
||||
@ -28,7 +28,7 @@ struct rebinder
|
||||
>
|
||||
struct container
|
||||
{
|
||||
typedef sg_multiset
|
||||
typedef treap_multiset
|
||||
< typename common_t::value_type
|
||||
, value_traits<ValueTraits>
|
||||
, constant_time_size<ConstantTimeSize>
|
||||
@ -41,25 +41,63 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//base
|
||||
typedef typename testval_traits_t::base_value_traits base_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::base_value_traits
|
||||
, typename testval_traits_t::auto_base_value_traits
|
||||
>::type base_hook_t;
|
||||
test::test_generic_multiset
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename testval_traits_t::member_value_traits member_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::member_value_traits
|
||||
, typename testval_traits_t::auto_member_value_traits
|
||||
>::type member_hook_t;
|
||||
test::test_generic_multiset
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_multiset
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -91,30 +129,30 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
//test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, true>::execute();
|
||||
//test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, true>::execute();
|
||||
//test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, true>::execute();
|
||||
//test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
test_main_template_bptr< false, true >::execute();
|
||||
test_main_template_bptr< true, false >::execute();
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -41,25 +41,63 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//base
|
||||
typedef typename testval_traits_t::base_value_traits base_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::base_value_traits
|
||||
, typename testval_traits_t::auto_base_value_traits
|
||||
>::type base_hook_t;
|
||||
test::test_generic_set
|
||||
< base_hook_t
|
||||
, rebinder<base_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename testval_traits_t::member_value_traits member_hook_t;
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
, typename testval_traits_t::member_value_traits
|
||||
, typename testval_traits_t::auto_member_value_traits
|
||||
>::type member_hook_t;
|
||||
test::test_generic_set
|
||||
< member_hook_t
|
||||
, rebinder<member_hook_t, ConstantTimeSize, DefaultHolder, Map>
|
||||
>::test_all();
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue_traits< bs_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_generic_set
|
||||
< typename testval_traits_t::nonhook_value_traits
|
||||
@ -91,24 +129,24 @@ int main()
|
||||
//Start with ('false', 'false', 'false') in sets and 'false', 'false', 'true' in multisets
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
//test_main_template<void*, false, false, true>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
//test_main_template<void*, false, true, true>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, false, false, Base>::execute();
|
||||
//test_main_template<void*, true, false, true>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
//test_main_template<void*, true, true, true>::execute();
|
||||
test_main_template<void*, true, true, false, Member>::execute();
|
||||
test_main_template<void*, true, true, true, NonMember>::execute();
|
||||
|
||||
//smart_ptr
|
||||
//test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, true, Base>::execute();
|
||||
//test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, true, Member>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, true, NonMember>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
//test_main_template<smart_ptr<void>, true, true, true>::execute();
|
||||
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
|
@ -54,8 +54,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool Map, bool DefaultHolder>
|
||||
class test_main_template
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -78,6 +88,23 @@ class test_main_template
|
||||
< base_hook_t //cache_begin, compare_hash, incremental
|
||||
, rebinder<base_hook_t, ConstantTimeSize, ConstantTimeSize, !ConstantTimeSize, !!ConstantTimeSize, Map, DefaultHolder>
|
||||
>::test_all(data);
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue<unordered_hooks<VoidPointer> > value_type;
|
||||
static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
|
||||
typedef typename ValueContainer< value_type >::type value_cont_type;
|
||||
value_cont_type data (6);
|
||||
for (int i = 0; i < 6; ++i)
|
||||
data[i].value_ = random_init[i];
|
||||
|
||||
typedef testvalue_traits< unordered_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -88,6 +115,24 @@ class test_main_template
|
||||
< member_hook_t //cache_begin, compare_hash, incremental
|
||||
, rebinder<member_hook_t, ConstantTimeSize, false, !ConstantTimeSize, false, !ConstantTimeSize, DefaultHolder>
|
||||
>::test_all(data);
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue<unordered_hooks<VoidPointer> > value_type;
|
||||
static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
|
||||
typedef typename ValueContainer< value_type >::type value_cont_type;
|
||||
value_cont_type data (6);
|
||||
for (int i = 0; i < 6; ++i)
|
||||
data[i].value_ = random_init[i];
|
||||
|
||||
typedef testvalue_traits< unordered_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_unordered
|
||||
< typename testval_traits_t::nonhook_value_traits //cache_begin, compare_hash, incremental
|
||||
@ -101,22 +146,21 @@ int main()
|
||||
//VoidPointer x ConstantTimeSize x Map x DefaultHolder
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
test_main_template<void*, true, false, false, NonMember>::execute();
|
||||
test_main_template<void*, true, true, false, Base>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
/*
|
||||
//bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
test_main_template_bptr< false, false >::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, false, Member>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false, NonMember>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false, Base>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false, Member>::execute();
|
||||
|
||||
////bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
//test_main_template_bptr< false, true >::execute();
|
||||
//test_main_template_bptr< true, false >::execute();
|
||||
test_main_template_bptr< true, true >::execute();
|
||||
*/
|
||||
//test_main_template_bptr< true, true >::execute();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -52,8 +52,18 @@ struct rebinder
|
||||
};
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool Map, bool DefaultHolder>
|
||||
class test_main_template
|
||||
enum HookType
|
||||
{
|
||||
Base,
|
||||
Member,
|
||||
NonMember
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map, HookType Type>
|
||||
class test_main_template;
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Base>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
@ -76,6 +86,23 @@ class test_main_template
|
||||
< base_hook_t //cache_begin, compare_hash, incremental
|
||||
, rebinder<base_hook_t, ConstantTimeSize, ConstantTimeSize, !ConstantTimeSize, !!ConstantTimeSize, Map, DefaultHolder>
|
||||
>::test_all(data);
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, Member>
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue<unordered_hooks<VoidPointer> > value_type;
|
||||
static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
|
||||
typedef typename ValueContainer< value_type >::type value_cont_type;
|
||||
value_cont_type data (6);
|
||||
for (int i = 0; i < 6; ++i)
|
||||
data[i].value_ = random_init[i];
|
||||
|
||||
typedef testvalue_traits< unordered_hooks<VoidPointer> > testval_traits_t;
|
||||
//member
|
||||
typedef typename detail::if_c
|
||||
< ConstantTimeSize
|
||||
@ -86,6 +113,24 @@ class test_main_template
|
||||
< member_hook_t //cache_begin, compare_hash, incremental
|
||||
, rebinder<member_hook_t, ConstantTimeSize, false, !ConstantTimeSize, false, !ConstantTimeSize, DefaultHolder>
|
||||
>::test_all(data);
|
||||
}
|
||||
};
|
||||
|
||||
template<class VoidPointer, bool ConstantTimeSize, bool DefaultHolder, bool Map>
|
||||
class test_main_template<VoidPointer, ConstantTimeSize, DefaultHolder, Map, NonMember>
|
||||
|
||||
{
|
||||
public:
|
||||
static void execute()
|
||||
{
|
||||
typedef testvalue<unordered_hooks<VoidPointer> > value_type;
|
||||
static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
|
||||
typedef typename ValueContainer< value_type >::type value_cont_type;
|
||||
value_cont_type data (6);
|
||||
for (int i = 0; i < 6; ++i)
|
||||
data[i].value_ = random_init[i];
|
||||
|
||||
typedef testvalue_traits< unordered_hooks<VoidPointer> > testval_traits_t;
|
||||
//nonmember
|
||||
test::test_unordered
|
||||
< typename testval_traits_t::nonhook_value_traits //cache_begin, compare_hash, incremental
|
||||
@ -99,16 +144,16 @@ int main()
|
||||
//VoidPointer x ConstantTimeSize x Map x DefaultHolder
|
||||
|
||||
//void pointer
|
||||
test_main_template<void*, false, false, false>::execute();
|
||||
test_main_template<void*, false, true, false>::execute();
|
||||
test_main_template<void*, true, false, false>::execute();
|
||||
test_main_template<void*, true, true, false>::execute();
|
||||
test_main_template<void*, false, false, false, Base>::execute();
|
||||
test_main_template<void*, false, true, false, Member>::execute();
|
||||
test_main_template<void*, true, false, false, NonMember>::execute();
|
||||
test_main_template<void*, true, true, false, Base>::execute();
|
||||
|
||||
//smart_ptr
|
||||
test_main_template<smart_ptr<void>, false, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false>::execute();
|
||||
test_main_template<smart_ptr<void>, false, false, false, Member>::execute();
|
||||
test_main_template<smart_ptr<void>, false, true, false, NonMember>::execute();
|
||||
test_main_template<smart_ptr<void>, true, false, false, Base>::execute();
|
||||
test_main_template<smart_ptr<void>, true, true, false, Member>::execute();
|
||||
|
||||
////bounded_ptr (bool ConstantTimeSize, bool Map)
|
||||
//test_main_template_bptr< false, false >::execute();
|
||||
|
Reference in New Issue
Block a user