|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53127 - in trunk: boost/unordered boost/unordered/detail libs/unordered/test/objects
From: daniel_james_at_[hidden]
Date: 2009-05-20 02:43:40
Author: danieljames
Date: 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
New Revision: 53127
URL: http://svn.boost.org/trac/boost/changeset/53127
Log:
Better configuration for boost.unordered.
Text files modified:
trunk/boost/unordered/detail/config.hpp | 8 ++++++++
trunk/boost/unordered/detail/hash_table.hpp | 3 ++-
trunk/boost/unordered/detail/hash_table_impl.hpp | 8 ++++----
trunk/boost/unordered/unordered_map.hpp | 12 ++++++++----
trunk/boost/unordered/unordered_set.hpp | 12 ++++++++----
trunk/libs/unordered/test/objects/exception.hpp | 2 +-
trunk/libs/unordered/test/objects/minimal.hpp | 2 +-
trunk/libs/unordered/test/objects/test.hpp | 2 +-
8 files changed, 33 insertions(+), 16 deletions(-)
Modified: trunk/boost/unordered/detail/config.hpp
==============================================================================
--- trunk/boost/unordered/detail/config.hpp (original)
+++ trunk/boost/unordered/detail/config.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -19,4 +19,12 @@
# define BOOST_UNORDERED_NO_HAS_MOVE_ASSIGN
#endif
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+ // STLport doesn't have std::forward.
+# else
+# define BOOST_UNORDERED_STD_FORWARD
+# endif
+#endif
+
#endif
Modified: trunk/boost/unordered/detail/hash_table.hpp
==============================================================================
--- trunk/boost/unordered/detail/hash_table.hpp (original)
+++ trunk/boost/unordered/detail/hash_table.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -12,6 +12,7 @@
#endif
#include <boost/config.hpp>
+#include <boost/unordered/detail/config.hpp>
#if !defined(BOOST_UNORDERED_EMPLACE_LIMIT)
#define BOOST_UNORDERED_EMPLACE_LIMIT 5
@@ -45,7 +46,7 @@
#include <boost/mpl/aux_/config/eti.hpp>
-#if !(defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL))
+#if !(defined(BOOST_UNORDERED_STD_FORWARD))
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
Modified: trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ trunk/boost/unordered/detail/hash_table_impl.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -198,7 +198,7 @@
}
}
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template <typename... Args>
void construct(Args&&... args)
{
@@ -1602,7 +1602,7 @@
// For maps if there is more than one argument, the key can be the first argument.
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template <typename Arg, typename Arg1, typename... Args>
static BOOST_DEDUCED_TYPENAME
boost::mpl::if_<
@@ -1733,7 +1733,7 @@
#if BOOST_UNORDERED_EQUIVALENT_KEYS
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
// Emplace (equivalent key containers)
// (I'm using an overloaded emplace for both 'insert' and 'emplace')
@@ -1943,7 +1943,7 @@
}
}
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
// Emplace (unique keys)
// (I'm using an overloaded emplace for both 'insert' and 'emplace')
Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -21,6 +21,10 @@
#include <boost/unordered/detail/move.hpp>
#endif
+#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#include <initializer_list>
+#endif
+
#if defined(BOOST_MSVC)
#pragma warning(push)
#if BOOST_MSVC >= 1400
@@ -135,7 +139,7 @@
#endif
#endif
-#if !defined(BOOST_NO_INITIALIZER_LISTS)
+#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
unordered_map(std::initializer_list<value_type> list,
size_type n = boost::unordered_detail::default_initial_bucket_count,
const hasher &hf = hasher(),
@@ -219,7 +223,7 @@
// modifiers
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template <class... Args>
std::pair<iterator, bool> emplace(Args&&... args)
{
@@ -585,7 +589,7 @@
#endif
#endif
-#if !defined(BOOST_NO_INITIALIZER_LISTS)
+#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
unordered_multimap(std::initializer_list<value_type> list,
size_type n = boost::unordered_detail::default_initial_bucket_count,
const hasher &hf = hasher(),
@@ -670,7 +674,7 @@
// modifiers
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template <class... Args>
iterator emplace(Args&&... args)
{
Modified: trunk/boost/unordered/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set.hpp (original)
+++ trunk/boost/unordered/unordered_set.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -21,6 +21,10 @@
#include <boost/unordered/detail/move.hpp>
#endif
+#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#include <initializer_list>
+#endif
+
#if defined(BOOST_MSVC)
#pragma warning(push)
#if BOOST_MSVC >= 1400
@@ -133,7 +137,7 @@
#endif
#endif
-#if !defined(BOOST_NO_INITIALIZER_LISTS)
+#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
unordered_set(std::initializer_list<value_type> list,
size_type n = boost::unordered_detail::default_initial_bucket_count,
const hasher &hf = hasher(),
@@ -217,7 +221,7 @@
// modifiers
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template <class... Args>
std::pair<iterator, bool> emplace(Args&&... args)
{
@@ -555,7 +559,7 @@
#endif
#endif
-#if !defined(BOOST_NO_INITIALIZER_LISTS)
+#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
unordered_multiset(std::initializer_list<value_type> list,
size_type n = boost::unordered_detail::default_initial_bucket_count,
const hasher &hf = hasher(),
@@ -639,7 +643,7 @@
// modifiers
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template <class... Args>
iterator emplace(Args&&... args)
{
Modified: trunk/libs/unordered/test/objects/exception.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/exception.hpp (original)
+++ trunk/libs/unordered/test/objects/exception.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -347,7 +347,7 @@
detail::tracker.track_construct((void*) p, sizeof(T), tag_);
}
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template<class... Args> void construct(pointer p, Args&&... args) {
UNORDERED_SCOPE(allocator::construct(pointer, Args&&...)) {
UNORDERED_EPOINT("Mock allocator construct function.");
Modified: trunk/libs/unordered/test/objects/minimal.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/minimal.hpp (original)
+++ trunk/libs/unordered/test/objects/minimal.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -229,7 +229,7 @@
void construct(pointer p, T const& t) { new((void*)p.ptr_) T(t); }
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template<class... Args> void construct(pointer p, Args&&... args) {
new((void*)p.ptr_) T(std::forward<Args>(args)...);
}
Modified: trunk/libs/unordered/test/objects/test.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/test.hpp (original)
+++ trunk/libs/unordered/test/objects/test.hpp 2009-05-20 02:43:38 EDT (Wed, 20 May 2009)
@@ -218,7 +218,7 @@
new(p) T(t);
}
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#if defined(BOOST_UNORDERED_STD_FORWARD)
template<class... Args> void construct(pointer p, Args&&... args) {
detail::tracker.track_construct((void*) p, sizeof(T), tag_);
new(p) T(std::forward<Args>(args)...);
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