Commit f7d6ad0a by François Dumont

hashtable_policy.h (_Hashtable_base<>::_M_eq()): protected rather than private, use it...

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

	* include/bits/hashtable_policy.h (_Hashtable_base<>::_M_eq()):
	protected rather than private, use it...
	* include/bits/hashtable.h (_Hashtable<>::key_eq()): ... here.
	* testsuite/23_containers/unordered_set/observers.cc: New.
	* testsuite/23_containers/unordered_multiset/observers.cc: New.
	* testsuite/23_containers/unordered_map/observers.cc: New.
	* testsuite/23_containers/unordered_multimap/observers.cc: New.

From-SVN: r182928
parent 86662207
2012-01-03 François Dumont <fdumont@gcc.gnu.org> 2012-01-05 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable_policy.h (_Hashtable_base<>::_M_eq()):
protected rather than private, use it...
* include/bits/hashtable.h (_Hashtable<>::key_eq()): ... here.
* testsuite/23_containers/unordered_set/observers.cc: New.
* testsuite/23_containers/unordered_multiset/observers.cc: New.
* testsuite/23_containers/unordered_map/observers.cc: New.
* testsuite/23_containers/unordered_multimap/observers.cc: New.
2012-01-03 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable_policy.h (_Ebo_helper<>): Rename to the more * include/bits/hashtable_policy.h (_Ebo_helper<>): Rename to the more
specific _Hashtable_ebo_helper. Hide this implementation detail thanks specific _Hashtable_ebo_helper. Hide this implementation detail thanks
......
...@@ -371,7 +371,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -371,7 +371,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Observers // Observers
key_equal key_equal
key_eq() const key_eq() const
{ return this->_M_eq; } { return this->_M_eq(); }
// hash_function, if present, comes from _Hash_code_base. // hash_function, if present, comes from _Hash_code_base.
......
...@@ -876,7 +876,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -876,7 +876,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::swap(_M_eq(), __x._M_eq()); std::swap(_M_eq(), __x._M_eq());
} }
private: protected:
const _Equal& const _Equal&
_M_eq() const { return _EboEqual::_S_cget(*this); } _M_eq() const { return _EboEqual::_S_cget(*this); }
_Equal& _Equal&
......
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <unordered_map>
void
test01()
{
std::unordered_map<int, int> um;
auto ke = um.key_eq();
auto h = um.hash_function();
}
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <unordered_map>
void
test01()
{
std::unordered_multimap<int, int> um;
auto ke = um.key_eq();
auto h = um.hash_function();
}
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <unordered_set>
void
test01()
{
std::unordered_multiset<int> us;
auto ke = us.key_eq();
auto h = us.hash_function();
}
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <unordered_set>
void
test01()
{
std::unordered_set<int> us;
auto ke = us.key_eq();
auto h = us.hash_function();
}
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