|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79762 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2012-07-26 18:23:10
Author: danieljames
Date: 2012-07-26 18:23:09 EDT (Thu, 26 Jul 2012)
New Revision: 79762
URL: http://svn.boost.org/trac/boost/changeset/79762
Log:
Unordered: Use a SFINAE parameter rather than return type for C++03 compilers.
Seems that g++ 3.4 has problems with overloads that are only distinguished by
SFINAE return types.
Text files modified:
trunk/boost/unordered/detail/allocate.hpp | 80 +++++++++++++++++++++-------------------
1 files changed, 42 insertions(+), 38 deletions(-)
Modified: trunk/boost/unordered/detail/allocate.hpp
==============================================================================
--- trunk/boost/unordered/detail/allocate.hpp (original)
+++ trunk/boost/unordered/detail/allocate.hpp 2012-07-26 18:23:09 EDT (Thu, 26 Jul 2012)
@@ -390,6 +390,7 @@
}
#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
+
#else // BOOST_NO_VARIADIC_TEMPLATES
////////////////////////////////////////////////////////////////////////////////
@@ -441,9 +442,9 @@
#undef BOOST_UNORDERED_CONSTRUCT_IMPL
template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<piecewise3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
+ inline void construct_impl(std::pair<A, B>* address,
+ boost::unordered::detail::emplace_args3<A0, A1, A2> const& args,
+ typename enable_if<piecewise3<A, B, A0>, void*>::type = 0)
{
boost::unordered::detail::construct_from_tuple(
boost::addressof(address->first), args.a1);
@@ -454,9 +455,9 @@
#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
template <typename A, typename B, typename A0>
- inline typename enable_if<emulation1<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args1<A0> const& args)
+ inline void construct_impl(std::pair<A, B>* address,
+ boost::unordered::detail::emplace_args1<A0> const& args,
+ typename enable_if<emulation1<A, B, A0>, void*>::type = 0)
{
new((void*) boost::addressof(address->first)) A(
boost::forward<A0>(args.a0));
@@ -464,9 +465,9 @@
}
template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<emulation3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
+ inline void construct_impl(std::pair<A, B>* address,
+ boost::unordered::detail::emplace_args3<A0, A1, A2> const& args,
+ typename enable_if<emulation3<A, B, A0>, void*>::type = 0)
{
new((void*) boost::addressof(address->first)) A(
boost::forward<A0>(args.a0));
@@ -811,35 +812,38 @@
# endif
template <typename Alloc>
- inline typename boost::enable_if_c<
+ inline Alloc call_select_on_container_copy_construction(const Alloc& rhs,
+ typename boost::enable_if_c<
boost::unordered::detail::
- has_select_on_container_copy_construction<Alloc>::value, Alloc
- >::type call_select_on_container_copy_construction(const Alloc& rhs)
+ has_select_on_container_copy_construction<Alloc>::value, void*
+ >::type = 0)
{
return rhs.select_on_container_copy_construction();
}
template <typename Alloc>
- inline typename boost::disable_if_c<
+ inline Alloc call_select_on_container_copy_construction(const Alloc& rhs,
+ typename boost::disable_if_c<
boost::unordered::detail::
- has_select_on_container_copy_construction<Alloc>::value, Alloc
- >::type call_select_on_container_copy_construction(const Alloc& rhs)
+ has_select_on_container_copy_construction<Alloc>::value, void*
+ >::type = 0)
{
return rhs;
}
template <typename SizeType, typename Alloc>
- inline typename boost::enable_if_c<
- boost::unordered::detail::has_max_size<Alloc>::value, SizeType
- >::type call_max_size(const Alloc& a)
+ inline SizeType call_max_size(const Alloc& a,
+ typename boost::enable_if_c<
+ boost::unordered::detail::has_max_size<Alloc>::value, void*
+ >::type = 0)
{
return a.max_size();
}
template <typename SizeType, typename Alloc>
- inline typename boost::disable_if_c<
- boost::unordered::detail::has_max_size<Alloc>::value, SizeType
- >::type call_max_size(const Alloc&)
+ inline SizeType call_max_size(const Alloc&, typename boost::disable_if_c<
+ boost::unordered::detail::has_max_size<Alloc>::value, void*
+ >::type = 0)
{
return (std::numeric_limits<SizeType>::max)();
}
@@ -967,41 +971,41 @@
// the only construct method that old fashioned allocators support.
template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- construct(Alloc& a, T* p, T const& x)
+ static void construct(Alloc& a, T* p, T const& x,
+ typename boost::enable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value &&
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
{
a.construct(p, x);
}
template <typename T>
- static typename boost::disable_if_c<
+ static void construct(Alloc&, T* p, T const& x,
+ typename boost::disable_if_c<
boost::unordered::detail::has_construct<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- construct(Alloc&, T* p, T const& x)
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
{
new ((void*) p) T(x);
}
template <typename T>
- static typename boost::enable_if_c<
+ static void destroy(Alloc& a, T* p,
+ typename boost::enable_if_c<
boost::unordered::detail::has_destroy<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- destroy(Alloc& a, T* p)
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
{
a.destroy(p);
}
template <typename T>
- static typename boost::disable_if_c<
+ static void destroy(Alloc&, T* p,
+ typename boost::disable_if_c<
boost::unordered::detail::has_destroy<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- destroy(Alloc&, T* p)
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
{
boost::unordered::detail::destroy(p);
}
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