|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2008-01-11 09:38:46
Author: danieljames
Date: 2008-01-11 09:38:45 EST (Fri, 11 Jan 2008)
New Revision: 42679
URL: http://svn.boost.org/trac/boost/changeset/42679
Log:
More workarounds for older compilers.
Text files modified:
branches/unordered/trunk/libs/unordered/test/exception/insert_exception_tests.cpp | 6 ++++--
branches/unordered/trunk/libs/unordered/test/objects/exception.hpp | 16 ++++++++++++++--
branches/unordered/trunk/libs/unordered/test/objects/memory.hpp | 11 +++++++----
branches/unordered/trunk/libs/unordered/test/unordered/Jamfile.v2 | 2 +-
4 files changed, 26 insertions(+), 9 deletions(-)
Modified: branches/unordered/trunk/libs/unordered/test/exception/insert_exception_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/exception/insert_exception_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/exception/insert_exception_tests.cpp 2008-01-11 09:38:45 EST (Fri, 11 Jan 2008)
@@ -101,13 +101,14 @@
insert_test_rehash1() : insert_test_base<T>(1000) {}
T init() const {
+ using namespace std;
typedef BOOST_DEDUCED_TYPENAME T::size_type size_type;
T x;
x.max_load_factor(0.25);
size_type bucket_count = x.bucket_count();
size_type initial_elements = static_cast<size_type>(
- std::ceil(bucket_count * x.max_load_factor()) - 1);
+ ceil(bucket_count * (double) x.max_load_factor()) - 1);
UNORDERED_REQUIRE(initial_elements < this->values.size());
x.insert(this->values.begin(),
boost::next(this->values.begin(), initial_elements));
@@ -165,6 +166,7 @@
insert_test_rehash3() : insert_test_base<T>(1000) {}
T init() const {
+ using namespace std;
typedef BOOST_DEDUCED_TYPENAME T::size_type size_type;
T x;
@@ -172,7 +174,7 @@
original_bucket_count = x.bucket_count();
rehash_bucket_count = static_cast<size_type>(
- std::ceil(original_bucket_count * x.max_load_factor())) - 1;
+ ceil(original_bucket_count * (double) x.max_load_factor())) - 1;
size_type initial_elements = rehash_bucket_count - 5;
Modified: branches/unordered/trunk/libs/unordered/test/objects/exception.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/objects/exception.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/objects/exception.hpp 2008-01-11 09:38:45 EST (Fri, 11 Jan 2008)
@@ -184,15 +184,17 @@
strong.store(x);
try {
ENABLE_EXCEPTIONS;
- call_ignore_extra_parameters(&Test::run, test_, x, strong);
+ call_ignore_extra_parameters<Test, BOOST_DEDUCED_TYPENAME Test::data_type, BOOST_DEDUCED_TYPENAME Test::strong_type>(&Test::run, test_, x, strong);
}
catch(...) {
- call_ignore_extra_parameters(&Test::check, test_,
+ call_ignore_extra_parameters<Test, BOOST_DEDUCED_TYPENAME Test::data_type const, BOOST_DEDUCED_TYPENAME Test::strong_type const>(&Test::check, test_,
constant(x), constant(strong));
throw;
}
}
};
+
+
#if defined(BOOST_UNORDERED_EXCEPTION_USE_TEST)
template <class Test>
@@ -626,5 +628,15 @@
}
}
+// Workaround for ADL deficient compilers
+#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
+namespace test
+{
+ test::exception::object generate(test::exception::object const* x) {
+ return test::exception::generate(x);
+ }
+}
+#endif
+
#endif
Modified: branches/unordered/trunk/libs/unordered/test/objects/memory.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/objects/memory.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/objects/memory.hpp 2008-01-11 09:38:45 EST (Fri, 11 Jan 2008)
@@ -6,6 +6,8 @@
#if !defined(BOOST_UNORDERED_TEST_MEMORY_HEADER)
#define BOOST_UNORDERED_TEST_MEMORY_HEADER
+#include <boost/mpl/apply.hpp>
+
#if defined(BOOST_UNORDERED_EXCEPTION_USE_TEST)
#define UNORDERED_CHECK(x) BOOST_CHECK(x)
#define UNORDERED_REQUIRE(x) BOOST_REQUIRE(x)
@@ -64,8 +66,7 @@
template <class AllocatorHolder = default_allocator_holder>
struct memory_tracker {
typedef std::map<memory_area, memory_track, memory_area_compare,
- BOOST_DEDUCED_TYPENAME AllocatorHolder::
- template apply<std::pair<memory_area const, memory_track> >::type
+ BOOST_DEDUCED_TYPENAME boost::mpl::apply1<AllocatorHolder, std::pair<memory_area const, memory_track> >::type
> allocated_memory_type;
allocated_memory_type allocated_memory;
@@ -117,8 +118,10 @@
}
else {
++count_allocations;
- allocated_memory[memory_area(ptr, (char*) ptr + n * size)] =
- memory_track(tag);
+ allocated_memory.insert(
+ std::pair<memory_area const, memory_track>(
+ memory_area(ptr, (char*) ptr + n * size),
+ memory_track(tag)));
}
}
Modified: branches/unordered/trunk/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/Jamfile.v2 2008-01-11 09:38:45 EST (Fri, 11 Jan 2008)
@@ -9,7 +9,7 @@
: requirements
<toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
<toolset>gcc:<cxxflags>-Wsign-promo
- <toolset>msvc:<cxxflags>/W4
+ #<toolset>msvc:<cxxflags>/W4
;
test-suite unordered
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk