forked from boostorg/intrusive
Updated copyright and fixed trailing whitespaces
[SVN r79435]
This commit is contained in:
1 parent
30215558ae
commit
a74f5d8942
74 files changed
+283
-324
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2010-2010
|
||||
// (C) Copyright Ion Gaztanaga 2010-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -134,7 +134,7 @@ void test_generic_assoc<ValueTraits, ContainerDefiner>::test_insert_erase_burst(
|
||||
typedef typename std::vector<value_type>::const_iterator cvec_iterator;
|
||||
//Random erasure
|
||||
std::vector<cvec_iterator> it_vector;
|
||||
|
||||
|
||||
for(cvec_iterator it(values.begin()), itend(values.end())
|
||||
; it != itend
|
||||
; ++it){
|
||||
@@ -396,7 +396,7 @@ void test_generic_assoc<ValueTraits, ContainerDefiner>::test_insert_before
|
||||
{
|
||||
assoc_type testset;
|
||||
typedef typename std::vector<value_type>::iterator vec_iterator;
|
||||
|
||||
|
||||
for(vec_iterator it(--values.end()); true; --it){
|
||||
testset.push_front(*it);
|
||||
if(it == values.begin()){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -92,7 +92,7 @@ void test_generic_multiset<ValueTraits, ContainerDefiner>::test_impl()
|
||||
testset.erase (testset.iterator_to (values[0]));
|
||||
testset.erase (testset.iterator_to (values[1]));
|
||||
testset.insert (values[1]);
|
||||
|
||||
|
||||
testset.erase (testset.iterator_to (values[2]));
|
||||
testset.erase (testset.iterator_to (values[3]));
|
||||
}
|
||||
@@ -127,8 +127,8 @@ void test_generic_multiset<ValueTraits, ContainerDefiner>::test_sort(std::vector
|
||||
|
||||
BOOST_TEST (testset2.begin()->value_ == 2);
|
||||
BOOST_TEST (testset2.rbegin()->value_ == 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
|
||||
template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
|
||||
void test_generic_multiset<ValueTraits, ContainerDefiner>::test_insert(std::vector<typename ValueTraits::value_type>& values)
|
||||
@@ -165,7 +165,7 @@ void test_generic_multiset<ValueTraits, ContainerDefiner>::test_insert(std::vect
|
||||
|
||||
{ int init_values [] = { 1, 3, 5 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testset.begin() ); }
|
||||
}
|
||||
}
|
||||
|
||||
//test: insert (seq-version), swap, erase (seq-version), size:
|
||||
template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
|
||||
@@ -191,7 +191,7 @@ void test_generic_multiset<ValueTraits, ContainerDefiner>::test_swap(std::vector
|
||||
testset1.erase (testset1.iterator_to(values[5]), testset1.end());
|
||||
BOOST_TEST (testset1.size() == 1);
|
||||
BOOST_TEST (&*testset1.begin() == &values[3]);
|
||||
}
|
||||
}
|
||||
|
||||
//test: find, equal_range (lower_bound, upper_bound):
|
||||
template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
|
||||
@@ -207,19 +207,21 @@ void test_generic_multiset<ValueTraits, ContainerDefiner>::test_find(std::vector
|
||||
multiset_type testset (values.begin(), values.end());
|
||||
typedef typename multiset_type::iterator iterator;
|
||||
|
||||
value_type cmp_val;
|
||||
cmp_val.value_ = 2;
|
||||
iterator i = testset.find (cmp_val);
|
||||
BOOST_TEST (i->value_ == 2);
|
||||
BOOST_TEST ((++i)->value_ == 2);
|
||||
std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
|
||||
|
||||
BOOST_TEST (range.first->value_ == 2);
|
||||
BOOST_TEST (range.second->value_ == 3);
|
||||
BOOST_TEST (std::distance (range.first, range.second) == 2);
|
||||
{
|
||||
value_type cmp_val;
|
||||
cmp_val.value_ = 2;
|
||||
iterator i = testset.find (cmp_val);
|
||||
BOOST_TEST (i->value_ == 2);
|
||||
BOOST_TEST ((++i)->value_ == 2);
|
||||
std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
|
||||
|
||||
cmp_val.value_ = 7;
|
||||
BOOST_TEST (testset.find (cmp_val) == testset.end());
|
||||
BOOST_TEST (range.first->value_ == 2);
|
||||
BOOST_TEST (range.second->value_ == 3);
|
||||
BOOST_TEST (std::distance (range.first, range.second) == 2);
|
||||
|
||||
cmp_val.value_ = 7;
|
||||
BOOST_TEST (testset.find (cmp_val) == testset.end());
|
||||
}
|
||||
}
|
||||
|
||||
}}} //namespace boost::intrusive::test
|
||||
|
||||
+19
-17
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -103,7 +103,7 @@ void test_generic_set<ValueTraits, ContainerDefiner>::test_impl()
|
||||
testset.erase (testset.iterator_to (values[0]));
|
||||
testset.erase (testset.iterator_to (values[1]));
|
||||
testset.insert (values[1]);
|
||||
|
||||
|
||||
testset.erase (testset.iterator_to (values[2]));
|
||||
testset.erase (testset.iterator_to (values[3]));
|
||||
}
|
||||
@@ -137,8 +137,8 @@ void test_generic_set<ValueTraits, ContainerDefiner>::test_sort(std::vector<type
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testset2.rbegin() ); }
|
||||
BOOST_TEST (testset2.begin()->value_ == 2);
|
||||
BOOST_TEST (testset2.rbegin()->value_ == 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//test: insert, const_iterator, const_reverse_iterator, erase, s_iterator_to:
|
||||
template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
|
||||
void test_generic_set<ValueTraits, ContainerDefiner>::test_insert(std::vector<typename ValueTraits::value_type>& values)
|
||||
@@ -263,7 +263,7 @@ void test_generic_set<ValueTraits, ContainerDefiner>::test_swap(std::vector<type
|
||||
BOOST_TEST (testset1.size() == 1);
|
||||
// BOOST_TEST (&testset1.front() == &values[3]);
|
||||
BOOST_TEST (&*testset1.begin() == &values[3]);
|
||||
}
|
||||
}
|
||||
|
||||
//test: find, equal_range (lower_bound, upper_bound):
|
||||
template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
|
||||
@@ -278,19 +278,21 @@ void test_generic_set<ValueTraits, ContainerDefiner>::test_find(std::vector<type
|
||||
set_type testset (values.begin(), values.end());
|
||||
typedef typename set_type::iterator iterator;
|
||||
|
||||
value_type cmp_val;
|
||||
cmp_val.value_ = 2;
|
||||
iterator i = testset.find (cmp_val);
|
||||
BOOST_TEST (i->value_ == 2);
|
||||
BOOST_TEST ((++i)->value_ != 2);
|
||||
std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
|
||||
|
||||
BOOST_TEST (range.first->value_ == 2);
|
||||
BOOST_TEST (range.second->value_ == 3);
|
||||
BOOST_TEST (std::distance (range.first, range.second) == 1);
|
||||
{
|
||||
value_type cmp_val;
|
||||
cmp_val.value_ = 2;
|
||||
iterator i = testset.find (cmp_val);
|
||||
BOOST_TEST (i->value_ == 2);
|
||||
BOOST_TEST ((++i)->value_ != 2);
|
||||
std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
|
||||
|
||||
cmp_val.value_ = 7;
|
||||
BOOST_TEST (testset.find (cmp_val) == testset.end());
|
||||
BOOST_TEST (range.first->value_ == 2);
|
||||
BOOST_TEST (range.second->value_ == 3);
|
||||
BOOST_TEST (std::distance (range.first, range.second) == 1);
|
||||
|
||||
cmp_val.value_ = 7;
|
||||
BOOST_TEST (testset.find (cmp_val) == testset.end());
|
||||
}
|
||||
}
|
||||
|
||||
}}} //namespace boost::intrusive::test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
@@ -31,14 +31,14 @@ struct private_type
|
||||
private_type const &operator,(int) const;
|
||||
};
|
||||
|
||||
typedef char yes_type;
|
||||
typedef char yes_type;
|
||||
struct no_type{ char dummy[2]; };
|
||||
|
||||
template<typename T>
|
||||
no_type is_private_type(T const &);
|
||||
yes_type is_private_type(private_type const &);
|
||||
|
||||
}}}}
|
||||
}}}}
|
||||
|
||||
|
||||
namespace boost{
|
||||
@@ -123,7 +123,7 @@ class has_member_function_named_func
|
||||
|
||||
template <class U>
|
||||
static has_member_function_callable_with::no_type Test(...);
|
||||
|
||||
|
||||
static const bool value
|
||||
= sizeof(Test< Fun >(0)) == sizeof(has_member_function_callable_with::yes_type);
|
||||
};
|
||||
@@ -186,7 +186,7 @@ class has_member_function_named_func
|
||||
);
|
||||
};
|
||||
|
||||
}}}
|
||||
}}}
|
||||
|
||||
namespace boost{
|
||||
namespace intrusive{
|
||||
@@ -216,7 +216,7 @@ class has_member_function_named_func
|
||||
)
|
||||
);
|
||||
};
|
||||
}}}
|
||||
}}}
|
||||
|
||||
namespace boost{
|
||||
namespace intrusive{
|
||||
@@ -308,7 +308,7 @@ class has_member_function_named_func
|
||||
|
||||
template <class U>
|
||||
static has_member_function_callable_with::no_type Test(...);
|
||||
|
||||
|
||||
static const bool value = sizeof(Test< Fun >(0))
|
||||
== sizeof(has_member_function_callable_with::yes_type);
|
||||
};
|
||||
@@ -460,7 +460,7 @@ int main()
|
||||
(void)check5;
|
||||
(void)check6;
|
||||
(void)check7;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -141,7 +141,7 @@ struct even_odd
|
||||
return v1.value_ < v2.value_;
|
||||
else
|
||||
return v2.value_ & 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct is_even
|
||||
@@ -149,7 +149,7 @@ struct is_even
|
||||
template<class Hooks, bool constant_time_size>
|
||||
bool operator()
|
||||
(const testvalue<Hooks, constant_time_size>& v1) const
|
||||
{ return (v1.value_ & 1) == 0; }
|
||||
{ return (v1.value_ & 1) == 0; }
|
||||
};
|
||||
/*
|
||||
struct int_testvalue_comp
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -114,7 +114,7 @@ void test_list<ValueTraits>
|
||||
|
||||
testlist.pop_front();
|
||||
BOOST_TEST (testlist.empty());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//test: constructor, iterator, reverse_iterator, sort, reverse:
|
||||
@@ -196,7 +196,7 @@ void test_list<ValueTraits>
|
||||
int init_values [] = { 1, 3, 4, 5 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() );
|
||||
}
|
||||
|
||||
|
||||
//test: assign, insert, const_iterator, const_reverse_iterator, erase, s_iterator_to:
|
||||
template<class ValueTraits>
|
||||
void test_list<ValueTraits>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
|
||||
// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2010
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -49,7 +49,7 @@ void instantiate()
|
||||
list< Foo, base_hook<ListBaseHook> > list_; list_.clear();
|
||||
slist< Foo, base_hook<SListBaseHook> > slist_; slist_.clear();
|
||||
set< Foo, base_hook<SetBaseHook> > set_; set_.clear();
|
||||
|
||||
|
||||
USet::bucket_type buckets[1];
|
||||
USet unordered_set_(USet::bucket_traits(buckets, 1)); unordered_set_.clear();
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007.
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
+8
-8
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -106,7 +106,7 @@ void test_slist<ValueTraits, Linear, CacheLast>
|
||||
> list_type;
|
||||
list_type testlist;
|
||||
BOOST_TEST (testlist.empty());
|
||||
|
||||
|
||||
testlist.push_front (values[0]);
|
||||
BOOST_TEST (testlist.size() == 1);
|
||||
BOOST_TEST (&testlist.front() == &values[0]);
|
||||
@@ -114,11 +114,11 @@ void test_slist<ValueTraits, Linear, CacheLast>
|
||||
testlist.push_front (values[1]);
|
||||
BOOST_TEST (testlist.size() == 2);
|
||||
BOOST_TEST (&testlist.front() == &values[1]);
|
||||
|
||||
|
||||
testlist.pop_front();
|
||||
BOOST_TEST (testlist.size() == 1);
|
||||
BOOST_TEST (&testlist.front() == &values[0]);
|
||||
|
||||
|
||||
testlist.pop_front();
|
||||
BOOST_TEST (testlist.empty());
|
||||
}
|
||||
@@ -241,8 +241,8 @@ void test_slist<ValueTraits, Linear, CacheLast>
|
||||
testlist.reverse();
|
||||
{ int init_values [] = { 5, 3, 1, 4, 2 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//test: assign, insert_after, const_iterator, erase_after, s_iterator_to, previous:
|
||||
template<class ValueTraits, bool Linear, bool CacheLast>
|
||||
void test_slist<ValueTraits, Linear, CacheLast>
|
||||
@@ -374,7 +374,7 @@ void test_slist<ValueTraits, Linear, CacheLast>
|
||||
testlist.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//test: insert_after (seq-version), swap, splice_after:
|
||||
template<class ValueTraits, bool Linear, bool CacheLast>
|
||||
@@ -476,7 +476,7 @@ void test_slist<ValueTraits, Linear, CacheLast>
|
||||
{ int init_values [] = { 1 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<class ValueTraits, bool Linear, bool CacheLast>
|
||||
void test_slist<ValueTraits, Linear, CacheLast>
|
||||
|
||||
+17
-69
@@ -113,18 +113,6 @@ class smart_ptr
|
||||
: m_ptr(0)
|
||||
{}
|
||||
|
||||
/*
|
||||
//!Constructor from raw pointer (allows "0" pointer conversion). Never throws.
|
||||
explicit smart_ptr(pointer ptr = 0)
|
||||
: m_ptr(ptr)
|
||||
{}
|
||||
|
||||
//!Constructor from other pointer. Never throws.
|
||||
template <class T>
|
||||
smart_ptr(T *ptr)
|
||||
: m_ptr(ptr)
|
||||
{}
|
||||
*/
|
||||
//!Constructor from other smart_ptr
|
||||
smart_ptr(const smart_ptr& ptr)
|
||||
: m_ptr(ptr.m_ptr)
|
||||
@@ -139,52 +127,20 @@ class smart_ptr
|
||||
smart_ptr(const smart_ptr<T2> &ptr)
|
||||
: m_ptr(ptr.m_ptr)
|
||||
{}
|
||||
/*
|
||||
//!Emulates static_cast operator. Never throws.
|
||||
template<class Y>
|
||||
smart_ptr(const smart_ptr<Y> & r, detail::static_cast_tag)
|
||||
: m_ptr(static_cast<PointedType*>(r.m_ptr))
|
||||
{}
|
||||
|
||||
//!Emulates const_cast operator. Never throws.
|
||||
template<class Y>
|
||||
smart_ptr(const smart_ptr<Y> & r, detail::const_cast_tag)
|
||||
: m_ptr(const_cast<PointedType*>(r.m_ptr))
|
||||
{}
|
||||
|
||||
//!Emulates dynamic_cast operator. Never throws.
|
||||
template<class Y>
|
||||
smart_ptr(const smart_ptr<Y> & r, detail::dynamic_cast_tag)
|
||||
: m_ptr(dynamic_cast<PointedType*>(r.m_ptr))
|
||||
{}
|
||||
|
||||
//!Emulates reinterpret_cast operator. Never throws.
|
||||
template<class Y>
|
||||
smart_ptr(const smart_ptr<Y> & r, detail::reinterpret_cast_tag)
|
||||
: m_ptr(reinterpret_cast<PointedType*>(r.m_ptr))
|
||||
{}
|
||||
|
||||
//!Obtains raw pointer from offset. Never throws.
|
||||
pointer get() const
|
||||
{ return m_ptr; }
|
||||
*/
|
||||
//!Pointer-like -> operator. It can return 0 pointer. Never throws.
|
||||
pointer operator->() const
|
||||
pointer operator->() const
|
||||
{ return m_ptr; }
|
||||
|
||||
//!Dereferencing operator, if it is a null smart_ptr behavior
|
||||
//! is undefined. Never throws.
|
||||
reference operator* () const
|
||||
reference operator* () const
|
||||
{ return *m_ptr; }
|
||||
|
||||
//!Indexing operator. Never throws.
|
||||
reference operator[](std::ptrdiff_t idx) const
|
||||
reference operator[](std::ptrdiff_t idx) const
|
||||
{ return m_ptr[idx]; }
|
||||
/*
|
||||
//!Assignment from pointer (saves extra conversion). Never throws.
|
||||
smart_ptr& operator= (pointer from)
|
||||
{ m_ptr = from; return *this; }
|
||||
*/
|
||||
|
||||
//!Assignment from other smart_ptr. Never throws.
|
||||
smart_ptr& operator= (const smart_ptr & pt)
|
||||
{ m_ptr = pt.m_ptr; return *this; }
|
||||
@@ -196,7 +152,7 @@ class smart_ptr
|
||||
{ m_ptr = pt.m_ptr; return *this; }
|
||||
|
||||
//!smart_ptr + std::ptrdiff_t. Never throws.
|
||||
smart_ptr operator+ (std::ptrdiff_t offset) const
|
||||
smart_ptr operator+ (std::ptrdiff_t offset) const
|
||||
{ smart_ptr s; s.m_ptr = m_ptr + offset; return s; }
|
||||
|
||||
//!smart_ptr - std::ptrdiff_t. Never throws.
|
||||
@@ -228,21 +184,13 @@ class smart_ptr
|
||||
{ smart_ptr temp(*this); --*this; return temp; }
|
||||
|
||||
//!safe bool conversion operator. Never throws.
|
||||
operator unspecified_bool_type() const
|
||||
operator unspecified_bool_type() const
|
||||
{ return m_ptr? &self_t::unspecified_bool_type_func : 0; }
|
||||
|
||||
//!Not operator. Not needed in theory, but improves portability.
|
||||
//!Never throws.
|
||||
bool operator! () const
|
||||
{ return m_ptr == 0; }
|
||||
/*
|
||||
friend void swap (smart_ptr &pt, smart_ptr &pt2)
|
||||
{
|
||||
value_type *ptr = pt.get();
|
||||
pt = pt2;
|
||||
pt2 = ptr;
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
||||
//!smart_ptr<T1> == smart_ptr<T2>. Never throws.
|
||||
@@ -293,12 +241,12 @@ inline std::basic_istream<E, T> & operator>>
|
||||
(std::basic_istream<E, T> & os, smart_ptr<Y> & p)
|
||||
{ Y * tmp; return os >> tmp; p = tmp; }
|
||||
|
||||
//!std::ptrdiff_t + smart_ptr
|
||||
//!std::ptrdiff_t + smart_ptr
|
||||
template<class T>
|
||||
inline smart_ptr<T> operator+(std::ptrdiff_t diff, const smart_ptr<T>& right)
|
||||
{ return right + diff; }
|
||||
|
||||
//!smart_ptr - smart_ptr
|
||||
//!smart_ptr - smart_ptr
|
||||
template<class T, class T2>
|
||||
inline std::ptrdiff_t operator- (const smart_ptr<T> &pt, const smart_ptr<T2> &pt2)
|
||||
{ return pt.operator->()- pt2.operator->(); }
|
||||
@@ -307,7 +255,7 @@ inline std::ptrdiff_t operator- (const smart_ptr<T> &pt, const smart_ptr<T2> &pt
|
||||
template<class T>
|
||||
inline void swap (smart_ptr<T> &pt,
|
||||
smart_ptr<T> &pt2)
|
||||
{
|
||||
{
|
||||
typename smart_ptr<T>::value_type *ptr = pt.operator->();
|
||||
pt = pt2;
|
||||
pt2 = ptr;
|
||||
@@ -317,32 +265,32 @@ inline void swap (smart_ptr<T> &pt,
|
||||
template<class T, class U>
|
||||
inline smart_ptr<T>
|
||||
static_pointer_cast(const smart_ptr<U> & r)
|
||||
{
|
||||
return smart_ptr<T>(r, detail::static_cast_tag());
|
||||
{
|
||||
return smart_ptr<T>(r, detail::static_cast_tag());
|
||||
}
|
||||
|
||||
//!Simulation of const_cast between pointers. Never throws.
|
||||
template<class T, class U>
|
||||
inline smart_ptr<T>const_pointer_cast(smart_ptr<U> const & r)
|
||||
{
|
||||
return smart_ptr<T>(r, detail::const_cast_tag());
|
||||
{
|
||||
return smart_ptr<T>(r, detail::const_cast_tag());
|
||||
}
|
||||
|
||||
//!Simulation of dynamic_cast between pointers. Never throws.
|
||||
template<class T, class U>
|
||||
inline smart_ptr<T>
|
||||
dynamic_pointer_cast(smart_ptr<U> const & r)
|
||||
{
|
||||
{
|
||||
return smart_ptr<T>
|
||||
(r, detail::dynamic_cast_tag());
|
||||
(r, detail::dynamic_cast_tag());
|
||||
}
|
||||
|
||||
//!Simulation of reinterpret_cast between pointers. Never throws.
|
||||
template<class T, class U>
|
||||
inline smart_ptr<T>
|
||||
reinterpret_pointer_cast(smart_ptr<U> const & r)
|
||||
{
|
||||
return smart_ptr<T>(r, detail::reinterpret_cast_tag());
|
||||
{
|
||||
return smart_ptr<T>(r, detail::reinterpret_cast_tag());
|
||||
}
|
||||
|
||||
} //namespace intrusive {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007.
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2011
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -247,7 +247,7 @@ void test_common_unordered_and_associative_container(Container & c, Data & d)
|
||||
{
|
||||
BOOST_TEST( c.find(*di) != c.end() );
|
||||
}
|
||||
|
||||
|
||||
typename Data::const_iterator db = d.begin();
|
||||
typename Data::const_iterator da = db++;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -157,7 +157,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
|
||||
testset.erase (testset.iterator_to (values[0]));
|
||||
testset.erase (testset.iterator_to (values[1]));
|
||||
testset.insert (values[1]);
|
||||
|
||||
|
||||
testset.erase (testset.iterator_to (values[2]));
|
||||
testset.erase (testset.iterator_to (values[3]));
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
|
||||
}
|
||||
testset1.clear();
|
||||
BOOST_TEST (testset1.empty());
|
||||
}
|
||||
}
|
||||
|
||||
//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
|
||||
template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
|
||||
@@ -231,7 +231,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
|
||||
|
||||
i = testset.insert (values[0]);
|
||||
BOOST_TEST (&*i == &values[0]);
|
||||
|
||||
|
||||
i = testset.iterator_to (values[2]);
|
||||
BOOST_TEST (&*i == &values[2]);
|
||||
testset.erase(i);
|
||||
@@ -275,7 +275,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
|
||||
|
||||
i = testset.insert (values[0]);
|
||||
BOOST_TEST (&*i == &values[0]);
|
||||
|
||||
|
||||
i = testset.iterator_to (values[2]);
|
||||
BOOST_TEST (&*i == &values[2]);
|
||||
testset.erase(i);
|
||||
@@ -442,7 +442,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>:
|
||||
// BOOST_TEST (&testset1.front() == &values[3]);
|
||||
BOOST_TEST (&*testset1.begin() == &values[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
|
||||
BOOST_TEST (testset1.size() == values.size());
|
||||
{ int init_values [] = { 1, 2, 2, 3, 4, 5 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
|
||||
}
|
||||
}
|
||||
|
||||
//test: find, equal_range (lower_bound, upper_bound):
|
||||
template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
|
||||
@@ -682,7 +682,7 @@ void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>:
|
||||
BOOST_TEST (i->value_ == 2);
|
||||
BOOST_TEST ((++i)->value_ == 2);
|
||||
std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
|
||||
|
||||
|
||||
BOOST_TEST (range.first->value_ == 2);
|
||||
BOOST_TEST (range.second->value_ == 3);
|
||||
BOOST_TEST (std::distance (range.first, range.second) == 2);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Olaf Krzikalla 2004-2006.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2006-2012.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -188,11 +188,11 @@ void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
|
||||
{ int init_values [] = { 1, 2, 3, 4, 5 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
|
||||
}
|
||||
|
||||
|
||||
testset1.clear();
|
||||
BOOST_TEST (testset1.empty());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
|
||||
template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
|
||||
void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
|
||||
@@ -251,7 +251,7 @@ void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
|
||||
{ int init_values [] = { 1, 3, 5 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//test: insert (seq-version), swap, erase (seq-version), size:
|
||||
template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
|
||||
@@ -299,7 +299,7 @@ void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
|
||||
BOOST_TEST (testset1.size() == 1);
|
||||
BOOST_TEST (&*testset1.begin() == &values[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//test: rehash:
|
||||
template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
|
||||
@@ -507,7 +507,7 @@ void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
|
||||
BOOST_TEST (testset1.size() == values.size()-1);
|
||||
{ int init_values [] = { 1, 2, 3, 4, 5 };
|
||||
TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//test: find, equal_range (lower_bound, upper_bound):
|
||||
@@ -538,7 +538,7 @@ void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
|
||||
BOOST_TEST (i->value_ == 2);
|
||||
BOOST_TEST ((++i)->value_ != 2);
|
||||
std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
|
||||
|
||||
|
||||
BOOST_TEST (range.first->value_ == 2);
|
||||
BOOST_TEST (range.second->value_ == 3);
|
||||
BOOST_TEST (std::distance (range.first, range.second) == 1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2007-2009
|
||||
// (C) Copyright Ion Gaztanaga 2007-2012
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -78,7 +78,7 @@ int main()
|
||||
|
||||
//Test the objects inserted in the base hook list
|
||||
for(; vect_it != vect_itend; ++vect_it, ++list_it)
|
||||
if(&*list_it != &*vect_it)
|
||||
if(&*list_it != &*vect_it)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user