|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76943 - in branches/release: . boost boost/unordered boost/unordered/detail libs libs/unordered libs/unordered/test/objects libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2012-02-07 15:48:53
Author: danieljames
Date: 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
New Revision: 76943
URL: http://svn.boost.org/trac/boost/changeset/76943
Log:
Unordered: Merge to release. Fixes #6522.
Fixes undefined macros, removes some unused code and fix some potential issues
for when `std::allocator_traits` is used.
Properties modified:
branches/release/ (props changed)
branches/release/boost/ (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/libs/ (props changed)
branches/release/libs/unordered/ (props changed)
Text files modified:
branches/release/boost/unordered/detail/allocator_helpers.hpp | 7 ++++++-
branches/release/boost/unordered/detail/extract_key.hpp | 15 ---------------
branches/release/libs/unordered/test/objects/minimal.hpp | 2 +-
branches/release/libs/unordered/test/unordered/Jamfile.v2 | 2 ++
branches/release/libs/unordered/test/unordered/allocator_traits.cpp | 24 ++++++++++++++++++++++++
branches/release/libs/unordered/test/unordered/compile_tests.hpp | 1 +
branches/release/libs/unordered/test/unordered/minimal_allocator.cpp | 6 ++++++
7 files changed, 40 insertions(+), 17 deletions(-)
Modified: branches/release/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- branches/release/boost/unordered/detail/allocator_helpers.hpp (original)
+++ branches/release/boost/unordered/detail/allocator_helpers.hpp 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -26,6 +26,10 @@
#include <boost/assert.hpp>
#include <boost/utility/addressof.hpp>
+#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
+#define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
+#endif
+
#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
# include <memory>
#endif
@@ -198,7 +202,8 @@
template <typename Alloc, typename T>
struct rebind_wrap
{
- typedef typename std::allocator_traits<Alloc>::rebind_alloc<T> type;
+ typedef typename std::allocator_traits<Alloc>::
+ template rebind_alloc<T> type;
};
#else
Modified: branches/release/boost/unordered/detail/extract_key.hpp
==============================================================================
--- branches/release/boost/unordered/detail/extract_key.hpp (original)
+++ branches/release/boost/unordered/detail/extract_key.hpp 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -51,13 +51,6 @@
return v;
}
-#if BOOST_UNORDERED_USE_RV_REF
- static key_type const& extract(BOOST_RV_REF(key_type) v)
- {
- return v;
- }
-#endif
-
static no_key extract()
{
return no_key();
@@ -69,7 +62,6 @@
{
return no_key();
}
-
#else
template <class Arg>
static no_key extract(Arg const&)
@@ -106,13 +98,6 @@
return v;
}
- // TODO: Why does this cause errors?
- //
- //static key_type const& extract(BOOST_RV_REF(key_type) v)
- //{
- // return v;
- //}
-
template <class Second>
static key_type const& extract(std::pair<key_type, Second> const& v)
{
Modified: branches/release/libs/unordered/test/objects/minimal.hpp
==============================================================================
--- branches/release/libs/unordered/test/objects/minimal.hpp (original)
+++ branches/release/libs/unordered/test/objects/minimal.hpp 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -333,7 +333,7 @@
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef void_ptr void_pointer;
- typedef void_const_ptr void_const_pointer;
+ typedef void_const_ptr const_void_pointer;
typedef ptr<T> pointer;
typedef const_ptr<T> const_pointer;
typedef T& reference;
Modified: branches/release/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- branches/release/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ branches/release/libs/unordered/test/unordered/Jamfile.v2 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -9,6 +9,8 @@
: requirements
<warnings>all
<toolset>intel:<warnings>on
+ # Would be nice to define -Wundef, but I'm getting warnings from
+ # Boost.Preprocessor on trunk.
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wno-long-long"
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
#<toolset>gcc:<define>_GLIBCXX_DEBUG
Modified: branches/release/libs/unordered/test/unordered/allocator_traits.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/allocator_traits.cpp (original)
+++ branches/release/libs/unordered/test/unordered/allocator_traits.cpp 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -90,7 +90,12 @@
{
typedef empty_allocator<int> allocator;
typedef boost::unordered::detail::allocator_traits<allocator> traits;
+#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
+ BOOST_MPL_ASSERT((boost::is_same<traits::size_type,
+ std::make_unsigned<std::ptrdiff_t>::type>));
+#else
BOOST_MPL_ASSERT((boost::is_same<traits::size_type, std::size_t>));
+#endif
BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
BOOST_MPL_ASSERT((boost::is_same<traits::pointer, int*>));
BOOST_MPL_ASSERT((boost::is_same<traits::const_pointer, int const*>));
@@ -123,7 +128,12 @@
{
typedef allocator1<int> allocator;
typedef boost::unordered::detail::allocator_traits<allocator> traits;
+#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
+ BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type,
+ std::make_unsigned<std::ptrdiff_t>::type>));
+#else
BOOST_MPL_ASSERT((boost::is_same<traits::size_type, std::size_t>));
+#endif
BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
BOOST_MPL_ASSERT((boost::is_same<traits::pointer, int*>));
BOOST_MPL_ASSERT((boost::is_same<traits::const_pointer, int const*>));
@@ -186,6 +196,20 @@
T& operator*() const { return *value_; }
};
+template <>
+struct ptr<void>
+{
+ void* value_;
+ ptr(void* v) : value_(v) {}
+};
+
+template <>
+struct ptr<const void>
+{
+ void const* value_;
+ ptr(void const* v) : value_(v) {}
+};
+
template <typename T>
struct allocator3
{
Modified: branches/release/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ branches/release/libs/unordered/test/unordered/compile_tests.hpp 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -22,6 +22,7 @@
#include <boost/type_traits/is_convertible.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/limits.hpp>
+#include <boost/utility/swap.hpp>
#include "../helpers/check_return_type.hpp"
typedef long double comparison_type;
Modified: branches/release/libs/unordered/test/unordered/minimal_allocator.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/minimal_allocator.cpp (original)
+++ branches/release/libs/unordered/test/unordered/minimal_allocator.cpp 2012-02-07 15:48:50 EST (Tue, 07 Feb 2012)
@@ -51,7 +51,13 @@
//BOOST_MPL_ASSERT((boost::is_same<typename traits::const_void_pointer, void const*>));
BOOST_MPL_ASSERT((boost::is_same<typename traits::difference_type, std::ptrdiff_t>));
+
+#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
+ BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type,
+ std::make_unsigned<std::ptrdiff_t>::type>));
+#else
BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type, std::size_t>));
+#endif
BOOST_TEST(!traits::propagate_on_container_copy_assignment::value);
BOOST_TEST(!traits::propagate_on_container_move_assignment::value);
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