From e73b90fa86d2d38cf2a06e0ab7993197cfbc756c Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 19 May 2007 20:04:14 +0000 Subject: [PATCH] ** empty log message ** [SVN r4139] --- test/objects/minimal.hpp | 2 +- test/unordered/constructor_tests.cpp | 5 +++-- test/unordered/erase_equiv_tests.cpp | 12 ++++++++---- test/unordered/insert_tests.cpp | 5 +++-- test/unordered/unnecessary_copy_tests.cpp | 8 ++++++++ 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/test/objects/minimal.hpp b/test/objects/minimal.hpp index 1d8d8452..31d26d5d 100644 --- a/test/objects/minimal.hpp +++ b/test/objects/minimal.hpp @@ -79,7 +79,7 @@ namespace minimal T* ptr_; - ptr(T* ptr) : ptr_(ptr) {} + ptr(T* x) : ptr_(x) {} public: ptr() : ptr_(0) {} diff --git a/test/unordered/constructor_tests.cpp b/test/unordered/constructor_tests.cpp index 18fd0194..34839530 100644 --- a/test/unordered/constructor_tests.cpp +++ b/test/unordered/constructor_tests.cpp @@ -244,9 +244,10 @@ void map_constructor_test(T* = 0) { std::cerr<<"map_constructor_test\n"; - typedef std::list > list; + typedef std::list > list; test::random_values v(1000); - list l(v.begin(), v.end()); + list l; + std::copy(v.begin(), v.end(), std::back_inserter(l)); T x(l.begin(), l.end()); diff --git a/test/unordered/erase_equiv_tests.cpp b/test/unordered/erase_equiv_tests.cpp index a36e6d80..d8f11e1a 100644 --- a/test/unordered/erase_equiv_tests.cpp +++ b/test/unordered/erase_equiv_tests.cpp @@ -109,8 +109,10 @@ void two_equivalent_item_tests() template bool compare(Range1 const& x, Range2 const& y) { - list a(x.begin(), x.end()); - list b(y.begin(), y.end()); + list a; + list b; + std::copy(x.begin(), x.end(), std::back_inserter(a)); + std::copy(y.begin(), y.end(), std::back_inserter(b)); a.sort(); b.sort(); return a == b; @@ -119,7 +121,8 @@ bool compare(Range1 const& x, Range2 const& y) template bool general_erase_range_test(Container& x, int start, int end) { - list l(x.begin(), x.end()); + list l; + std::copy(x.begin(), x.end(), std::back_inserter(l)); l.erase(boost::next(l.begin(), start), boost::next(l.begin(), end)); x.erase(boost::next(x.begin(), start), boost::next(x.begin(), end)); return compare(l, x); @@ -131,7 +134,8 @@ void erase_subrange_tests(Container const& x) for(std::size_t length = 0; length < x.size(); ++length) { for(std::size_t position = 0; position < x.size() - length; ++position) { Container y(x); - list init(y.begin(), y.end()); + list init; + std::copy(y.begin(), y.end(), std::back_inserter(init)); if(!general_erase_range_test(y, position, position + length)) { BOOST_ERROR("general_erase_range_test failed."); std::cout<<"Erase: ["< > list; + typedef std::list > list; test::random_values v(1000); - list l(v.begin(), v.end()); + list l; + std::copy(v.begin(), v.end(), std::back_inserter(l)); X x; x.insert(l.begin(), l.end()); diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp index 395a87fe..19255ba2 100644 --- a/test/unordered/unnecessary_copy_tests.cpp +++ b/test/unordered/unnecessary_copy_tests.cpp @@ -16,10 +16,18 @@ private: count_copies& operator=(count_copies const&); }; +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) +namespace boost { +#endif + std::size_t hash_value(count_copies const& x) { return 0; } +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) +} +#endif + bool operator==(count_copies const& x, count_copies const& y) { return true; }