Commit 0dd49691 by François Dumont

hashtable_policy.h (__details::_Before_begin<>): New, combine a base node…

hashtable_policy.h (__details::_Before_begin<>): New, combine a base node instance and an allocator.

2012-11-01  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (__details::_Before_begin<>):
	New, combine a base node instance and an allocator.
	* include/bits/hashtable.h (_Hashtable<>::_M_node_allocator): Remove.
	(_Hashtable<>::_M_before_begin): Rename into _M_bbegin and type
	modified to __detail::_Before_begin<>.
	(_Hashtable<>::_M_node_allocator()): New, get the node allocator
	part of _M_bbegin.
	(_Hashtable<>::_M_before_begin()): New, get the before begin node
	part of _M_bbegin.
	(_Hashtable<>): Adapt to use latter.

From-SVN: r193068
parent 647d030f
2012-11-01 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable_policy.h (__details::_Before_begin<>):
New, combine a base node instance and an allocator.
* include/bits/hashtable.h (_Hashtable<>::_M_node_allocator): Remove.
(_Hashtable<>::_M_before_begin): Rename into _M_bbegin and type
modified to __detail::_Before_begin<>.
(_Hashtable<>::_M_node_allocator()): New, get the node allocator
part of _M_bbegin.
(_Hashtable<>::_M_before_begin()): New, get the before begin node
part of _M_bbegin.
(_Hashtable<>): Adapt to use latter.
2012-11-01 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/forward_list.h (forward_list::assign): Dispatch to new
......
......@@ -1708,6 +1708,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return true;
}
/**
* This type is to combine a _Hash_node_base instance with an allocator
* instance through inheritance to benefit from EBO when possible.
*/
template<typename _NodeAlloc>
struct _Before_begin : public _NodeAlloc
{
_Hash_node_base _M_node;
_Before_begin(const _Before_begin&) = default;
_Before_begin(_Before_begin&&) = default;
template<typename _Alloc>
_Before_begin(_Alloc&& __a)
: _NodeAlloc(std::forward<_Alloc>(__a))
{ }
};
//@} hashtable-detail
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
......
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