Commit 79466838 by Jonathan Wakely Committed by Jonathan Wakely

alloc_traits.h (__alloctr_rebind): Remove.

	* include/bits/alloc_traits.h (__alloctr_rebind): Remove.
	(__allocator_traits_base): New base class.
	(__alloc_rebind): Reimplement in terms of detection idiom.
	(allocator_traits): Derive from __allocator_traits_base. Reimplement
	nested types in terms of detection idiom. Simplify SFINAE constraints
	on overloaded static member functions.
	* include/bits/hashtable.h (_Hashtable): Use __alloc_rebind instead
	of __alloctr_rebind.
	* testsuite/20_util/scoped_allocator/propagation.cc: Define rebind.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
	dg-error line number.

From-SVN: r225244
parent 4f44c555
2015-07-01 Jonathan Wakely <jwakely@redhat.com>
* include/bits/alloc_traits.h (__alloctr_rebind): Remove.
(__allocator_traits_base): New base class.
(__alloc_rebind): Reimplement in terms of detection idiom.
(allocator_traits): Derive from __allocator_traits_base. Reimplement
nested types in terms of detection idiom. Simplify SFINAE constraints
on overloaded static member functions.
* include/bits/hashtable.h (_Hashtable): Use __alloc_rebind instead
of __alloctr_rebind.
* testsuite/20_util/scoped_allocator/propagation.cc: Define rebind.
* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
dg-error line number.
* include/bits/ptr_traits.h (__ptrtr_elt_type, __ptrtr_diff_type,
__ptrtr_rebind, __ptrtr_not_void): Remove
(__get_first_arg, __replace_first_arg, __make_not_void): Define new
......
......@@ -179,15 +179,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public __detail::_Equality<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>,
private __detail::_Hashtable_alloc<
typename __alloctr_rebind<_Alloc,
__detail::_Hash_node<_Value,
_Traits::__hash_cached::value> >::__type>
__alloc_rebind<_Alloc,
__detail::_Hash_node<_Value,
_Traits::__hash_cached::value>>>
{
using __traits_type = _Traits;
using __hash_cached = typename __traits_type::__hash_cached;
using __node_type = __detail::_Hash_node<_Value, __hash_cached::value>;
using __node_alloc_type =
typename __alloctr_rebind<_Alloc, __node_type>::__type;
using __node_alloc_type = __alloc_rebind<_Alloc, __node_type>;
using __hashtable_alloc = __detail::_Hashtable_alloc<__node_alloc_type>;
......
......@@ -41,6 +41,10 @@ template<typename T>
template<typename T, bool copy, bool move, bool swap>
struct test_allocator : minimal_allocator<T>
{
template<typename U>
struct rebind
{ using other = test_allocator<U, copy, move, swap>; };
struct propagate_on_container_copy_assignment
: std::integral_constant<bool, copy> { };
......
......@@ -19,7 +19,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// { dg-error "with noexcept" "" { target *-*-* } 266 }
// { dg-error "with noexcept" "" { target *-*-* } 265 }
#include <unordered_set>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment