head 1.1;
branch 1.1.1;
access;
symbols
perseant-exfatfs-base-20261102:1.1.1.13
netbsd-11-1-RELEASE:1.1.1.12
gcc-14-4-0:1.1.1.13
netbsd-10-2-RELEASE:1.1.1.11
netbsd-9-5-RELEASE:1.1.1.5
netbsd-11-0-RELEASE:1.1.1.12
netbsd-11-0-RC7:1.1.1.12
netbsd-11-0-RC6:1.1.1.12
netbsd-11-0-RC5:1.1.1.12
netbsd-11-0-RC4:1.1.1.12
netbsd-11-0-RC3:1.1.1.12
netbsd-11-0-RC2:1.1.1.12
netbsd-11-0-RC1:1.1.1.12
gcc-14-3-0:1.1.1.13
perseant-exfatfs-base-20250801:1.1.1.12
netbsd-11:1.1.1.12.0.4
netbsd-11-base:1.1.1.12
gcc-12-5-0:1.1.1.12
netbsd-10-1-RELEASE:1.1.1.11
perseant-exfatfs-base-20240630:1.1.1.12
gcc-12-4-0:1.1.1.12
perseant-exfatfs:1.1.1.12.0.2
perseant-exfatfs-base:1.1.1.12
netbsd-8-3-RELEASE:1.1.1.3
netbsd-9-4-RELEASE:1.1.1.5
netbsd-10-0-RELEASE:1.1.1.11
netbsd-10-0-RC6:1.1.1.11
netbsd-10-0-RC5:1.1.1.11
netbsd-10-0-RC4:1.1.1.11
netbsd-10-0-RC3:1.1.1.11
netbsd-10-0-RC2:1.1.1.11
netbsd-10-0-RC1:1.1.1.11
gcc-12-3-0:1.1.1.12
gcc-10-5-0:1.1.1.11
netbsd-10:1.1.1.11.0.2
netbsd-10-base:1.1.1.11
netbsd-9-3-RELEASE:1.1.1.5
gcc-10-4-0:1.1.1.11
cjep_sun2x-base1:1.1.1.10
cjep_sun2x:1.1.1.10.0.4
cjep_sun2x-base:1.1.1.10
cjep_staticlib_x-base1:1.1.1.10
netbsd-9-2-RELEASE:1.1.1.5
cjep_staticlib_x:1.1.1.10.0.2
cjep_staticlib_x-base:1.1.1.10
gcc-10-3-0:1.1.1.10
netbsd-9-1-RELEASE:1.1.1.5
gcc-9-3-0:1.1.1.9
gcc-7-5-0:1.1.1.7
phil-wifi-20200421:1.1.1.6
phil-wifi-20200411:1.1.1.6
is-mlppp:1.1.1.6.0.2
is-mlppp-base:1.1.1.6
phil-wifi-20200406:1.1.1.6
netbsd-8-2-RELEASE:1.1.1.3
gcc-8-4-0:1.1.1.8
netbsd-9-0-RELEASE:1.1.1.5
netbsd-9-0-RC2:1.1.1.5
netbsd-9-0-RC1:1.1.1.5
phil-wifi-20191119:1.1.1.6
gcc-8-3-0:1.1.1.6
netbsd-9:1.1.1.5.0.2
netbsd-9-base:1.1.1.5
phil-wifi-20190609:1.1.1.5
netbsd-8-1-RELEASE:1.1.1.3
netbsd-8-1-RC1:1.1.1.3
pgoyette-compat-merge-20190127:1.1.1.4.2.1
pgoyette-compat-20190127:1.1.1.5
gcc-7-4-0:1.1.1.5
pgoyette-compat-20190118:1.1.1.4
pgoyette-compat-1226:1.1.1.4
pgoyette-compat-1126:1.1.1.4
gcc-6-5-0:1.1.1.4
pgoyette-compat-1020:1.1.1.4
pgoyette-compat-0930:1.1.1.4
pgoyette-compat-0906:1.1.1.4
netbsd-7-2-RELEASE:1.1.1.2
pgoyette-compat-0728:1.1.1.4
netbsd-8-0-RELEASE:1.1.1.3
phil-wifi:1.1.1.4.0.4
phil-wifi-base:1.1.1.4
pgoyette-compat-0625:1.1.1.4
netbsd-8-0-RC2:1.1.1.3
pgoyette-compat-0521:1.1.1.4
pgoyette-compat-0502:1.1.1.4
pgoyette-compat-0422:1.1.1.4
netbsd-8-0-RC1:1.1.1.3
pgoyette-compat-0415:1.1.1.4
pgoyette-compat-0407:1.1.1.4
pgoyette-compat-0330:1.1.1.4
pgoyette-compat-0322:1.1.1.4
pgoyette-compat-0315:1.1.1.4
netbsd-7-1-2-RELEASE:1.1.1.2
pgoyette-compat:1.1.1.4.0.2
pgoyette-compat-base:1.1.1.4
gcc-6-4-0:1.1.1.4
netbsd-7-1-1-RELEASE:1.1.1.2
gcc-5-5-0:1.1.1.3
matt-nb8-mediatek:1.1.1.3.0.12
matt-nb8-mediatek-base:1.1.1.3
perseant-stdc-iso10646:1.1.1.3.0.10
perseant-stdc-iso10646-base:1.1.1.3
netbsd-8:1.1.1.3.0.8
netbsd-8-base:1.1.1.3
prg-localcount2-base3:1.1.1.3
prg-localcount2-base2:1.1.1.3
prg-localcount2-base1:1.1.1.3
prg-localcount2:1.1.1.3.0.6
prg-localcount2-base:1.1.1.3
pgoyette-localcount-20170426:1.1.1.3
bouyer-socketcan-base1:1.1.1.3
pgoyette-localcount-20170320:1.1.1.3
netbsd-7-1:1.1.1.2.0.10
netbsd-7-1-RELEASE:1.1.1.2
netbsd-7-1-RC2:1.1.1.2
netbsd-7-nhusb-base-20170116:1.1.1.2
bouyer-socketcan:1.1.1.3.0.4
bouyer-socketcan-base:1.1.1.3
pgoyette-localcount-20170107:1.1.1.3
netbsd-7-1-RC1:1.1.1.2
pgoyette-localcount-20161104:1.1.1.3
netbsd-7-0-2-RELEASE:1.1.1.2
localcount-20160914:1.1.1.3
netbsd-7-nhusb:1.1.1.2.0.8
netbsd-7-nhusb-base:1.1.1.2
pgoyette-localcount-20160806:1.1.1.3
pgoyette-localcount-20160726:1.1.1.3
pgoyette-localcount:1.1.1.3.0.2
pgoyette-localcount-base:1.1.1.3
gcc-5-4-0:1.1.1.3
netbsd-7-0-1-RELEASE:1.1.1.2
gcc-5-3-0:1.1.1.3
netbsd-7-0:1.1.1.2.0.6
netbsd-7-0-RELEASE:1.1.1.2
gcc-4-8-5-pre-gcc-old-import:1.1.1.2
netbsd-7-0-RC3:1.1.1.2
netbsd-7-0-RC2:1.1.1.2
post-gcc-4-8-5-merge:1.1.1.2
gcc-4-8-5:1.1.1.2
netbsd-7-0-RC1:1.1.1.2
gcc-4-8-4:1.1.1.2
gcc-4-8-20141009:1.1.1.2
netbsd-6-0-6-RELEASE:1.1.1.1
netbsd-6-1-5-RELEASE:1.1.1.1
netbsd-7:1.1.1.2.0.4
netbsd-7-base:1.1.1.2
gcc-4-8-3:1.1.1.2
yamt-pagecache-base9:1.1.1.2
yamt-pagecache-tag8:1.1.1.1
netbsd-6-1-4-RELEASE:1.1.1.1
netbsd-6-0-5-RELEASE:1.1.1.1
tls-earlyentropy:1.1.1.2.0.2
tls-earlyentropy-base:1.1.1.2
riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2
riastradh-drm2-base3:1.1.1.2
gcc-4-8-3-pre-r208254:1.1.1.2
gcc-4-8-3-pre-r206687:1.1.1.2
imported-to-gcc-old-20140227-0107:1.1.1.1
netbsd-6-1-3-RELEASE:1.1.1.1
netbsd-6-0-4-RELEASE:1.1.1.1
netbsd-6-1-2-RELEASE:1.1.1.1
netbsd-6-0-3-RELEASE:1.1.1.1
netbsd-6-1-1-RELEASE:1.1.1.1
riastradh-drm2-base2:1.1.1.1
riastradh-drm2-base1:1.1.1.1
riastradh-drm2:1.1.1.1.0.12
riastradh-drm2-base:1.1.1.1
netbsd-6-1:1.1.1.1.0.16
netbsd-6-0-2-RELEASE:1.1.1.1
netbsd-6-1-RELEASE:1.1.1.1
netbsd-6-1-RC4:1.1.1.1
netbsd-6-1-RC3:1.1.1.1
agc-symver:1.1.1.1.0.14
agc-symver-base:1.1.1.1
netbsd-6-1-RC2:1.1.1.1
netbsd-6-1-RC1:1.1.1.1
yamt-pagecache-base8:1.1.1.1
netbsd-6-0-1-RELEASE:1.1.1.1
yamt-pagecache-base7:1.1.1.1
matt-nb6-plus-nbase:1.1.1.1
yamt-pagecache-base6:1.1.1.1
netbsd-6-0:1.1.1.1.0.10
netbsd-6-0-RELEASE:1.1.1.1
gcc-4-5-4:1.1.1.1
netbsd-6-0-RC2:1.1.1.1
tls-maxphys:1.1.1.1.0.8
tls-maxphys-base:1.1.1.2
matt-nb6-plus:1.1.1.1.0.6
matt-nb6-plus-base:1.1.1.1
netbsd-6-0-RC1:1.1.1.1
yamt-pagecache-base5:1.1.1.1
yamt-pagecache-base4:1.1.1.1
netbsd-6:1.1.1.1.0.4
netbsd-6-base:1.1.1.1
yamt-pagecache-base3:1.1.1.1
yamt-pagecache-base2:1.1.1.1
yamt-pagecache:1.1.1.1.0.2
yamt-pagecache-base:1.1.1.1
gcc-4-5-3:1.1.1.1
FSF:1.1.1;
locks; strict;
comment @# @;
1.1
date 2011.06.21.01.24.47; author mrg; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2011.06.21.01.24.47; author mrg; state Exp;
branches
1.1.1.1.2.1
1.1.1.1.8.1;
next 1.1.1.2;
1.1.1.2
date 2014.03.01.08.41.31; author mrg; state Exp;
branches;
next 1.1.1.3;
commitid TtaB91QNTknAoYqx;
1.1.1.3
date 2016.01.24.06.05.53; author mrg; state Exp;
branches;
next 1.1.1.4;
commitid uWWfbLp08zOK79Sy;
1.1.1.4
date 2018.02.02.01.59.03; author mrg; state Exp;
branches
1.1.1.4.2.1
1.1.1.4.4.1;
next 1.1.1.5;
commitid XNKaycqpfhzd5epA;
1.1.1.5
date 2019.01.19.10.14.11; author mrg; state Exp;
branches;
next 1.1.1.6;
commitid VQ8OwWIg5RS9kn8B;
1.1.1.6
date 2019.10.01.09.36.06; author mrg; state Exp;
branches;
next 1.1.1.7;
commitid smvgr2IPAQDr89FB;
1.1.1.7
date 2020.08.11.05.10.39; author mrg; state Exp;
branches;
next 1.1.1.8;
commitid 5dBRDT7i6e65xBjC;
1.1.1.8
date 2020.08.11.05.30.09; author mrg; state Exp;
branches;
next 1.1.1.9;
commitid 7AI4OfpLi4eqEBjC;
1.1.1.9
date 2020.09.05.07.52.09; author mrg; state Exp;
branches;
next 1.1.1.10;
commitid ZRYA7IOuwfMjAPmC;
1.1.1.10
date 2021.04.10.22.10.03; author mrg; state Exp;
branches;
next 1.1.1.11;
commitid eC4g0MRpqTvEkNOC;
1.1.1.11
date 2022.07.22.19.52.36; author mrg; state Exp;
branches;
next 1.1.1.12;
commitid fUYPgdKzIHqhwVMD;
1.1.1.12
date 2023.07.30.05.21.20; author mrg; state Exp;
branches
1.1.1.12.2.1;
next 1.1.1.13;
commitid tk6nV4mbc9nVEMyE;
1.1.1.13
date 2025.09.13.23.45.48; author mrg; state Exp;
branches;
next ;
commitid KwhwN4krNWa6XBaG;
1.1.1.1.2.1
date 2014.05.22.16.37.49; author yamt; state Exp;
branches;
next ;
commitid DX8bafDLmqEbpyBx;
1.1.1.1.8.1
date 2014.08.19.23.54.50; author tls; state Exp;
branches;
next ;
commitid jTnpym9Qu0o4R1Nx;
1.1.1.4.2.1
date 2019.01.26.21.59.34; author pgoyette; state Exp;
branches;
next ;
commitid JKpcmvSjdT25dl9B;
1.1.1.4.4.1
date 2019.06.10.21.54.51; author christos; state Exp;
branches;
next 1.1.1.4.4.2;
commitid jtc8rnCzWiEEHGqB;
1.1.1.4.4.2
date 2020.04.13.07.58.37; author martin; state Exp;
branches;
next ;
commitid X01YhRUPVUDaec4C;
1.1.1.12.2.1
date 2026.11.04.22.51.55; author perseant; state Exp;
branches;
next ;
commitid 3QTNojfCEH9lUb2H;
desc
@@
1.1
log
@Initial revision
@
text
@// Debugging unordered_map/unordered_multimap implementation -*- C++ -*-
// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// 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 even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// .
/** @@file debug/unordered_map
* This file is a GNU debug extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_DEBUG_UNORDERED_MAP
#define _GLIBCXX_DEBUG_UNORDERED_MAP 1
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include
#else
# include
#include
#include
namespace std
{
namespace __debug
{
/// Class std::unordered_map with safety/checking/debug instrumentation.
template,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<_Key> >
class unordered_map
: public _GLIBCXX_STD_D::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
public __gnu_debug::_Safe_sequence >
{
typedef _GLIBCXX_STD_D::unordered_map<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base;
typedef __gnu_debug::_Safe_sequence _Safe_base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
typedef __gnu_debug::_Safe_iterator iterator;
typedef __gnu_debug::_Safe_iterator const_iterator;
explicit
unordered_map(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a) { }
template
unordered_map(_InputIterator __f, _InputIterator __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
__hf, __eql, __a), _Safe_base() { }
unordered_map(const unordered_map& __x)
: _Base(__x), _Safe_base() { }
unordered_map(const _Base& __x)
: _Base(__x), _Safe_base() { }
unordered_map(unordered_map&& __x)
: _Base(std::forward(__x)), _Safe_base() { }
unordered_map(initializer_list __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
unordered_map&
operator=(const unordered_map& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
unordered_map&
operator=(unordered_map&& __x)
{
// NB: DR 1204.
// NB: DR 675.
clear();
swap(__x);
return *this;
}
unordered_map&
operator=(initializer_list __l)
{
this->clear();
this->insert(__l);
return *this;
}
void
swap(unordered_map& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__x);
}
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
iterator
begin()
{ return iterator(_Base::begin(), this); }
const_iterator
begin() const
{ return const_iterator(_Base::begin(), this); }
iterator
end()
{ return iterator(_Base::end(), this); }
const_iterator
end() const
{ return const_iterator(_Base::end(), this); }
const_iterator
cbegin() const
{ return const_iterator(_Base::begin(), this); }
const_iterator
cend() const
{ return const_iterator(_Base::end(), this); }
// local versions
using _Base::begin;
using _Base::end;
using _Base::cbegin;
using _Base::cend;
std::pair
insert(const value_type& __obj)
{
typedef std::pair __pair_type;
__pair_type __res = _Base::insert(__obj);
return std::make_pair(iterator(__res.first, this), __res.second);
}
iterator
insert(const_iterator, const value_type& __obj)
{
typedef std::pair __pair_type;
__pair_type __res = _Base::insert(__obj);
return iterator(__res.first, this);
}
void
insert(std::initializer_list __l)
{ _Base::insert(__l); }
template
void
insert(_InputIterator __first, _InputIterator __last)
{
__glibcxx_check_valid_range(__first, __last);
_Base::insert(__first, __last);
}
iterator
find(const key_type& __key)
{ return iterator(_Base::find(__key), this); }
const_iterator
find(const key_type& __key) const
{ return const_iterator(_Base::find(__key), this); }
std::pair
equal_range(const key_type& __key)
{
typedef typename _Base::iterator _Base_iterator;
typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
__pair_type __res = _Base::equal_range(__key);
return std::make_pair(iterator(__res.first, this),
iterator(__res.second, this));
}
std::pair
equal_range(const key_type& __key) const
{
typedef typename _Base::const_iterator _Base_iterator;
typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
__pair_type __res = _Base::equal_range(__key);
return std::make_pair(const_iterator(__res.first, this),
const_iterator(__res.second, this));
}
size_type
erase(const key_type& __key)
{
size_type __ret(0);
iterator __victim(_Base::find(__key), this);
if (__victim != end())
{
this->erase(__victim);
__ret = 1;
}
return __ret;
}
iterator
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
__it._M_invalidate();
return iterator(_Base::erase(__it.base()), this);
}
iterator
erase(const_iterator __first, const_iterator __last)
{
__glibcxx_check_erase_range(__first, __last);
for (const_iterator __tmp = __first; __tmp != __last;)
{
const_iterator __victim = __tmp++;
__victim._M_invalidate();
}
return iterator(_Base::erase(__first.base(),
__last.base()), this);
}
_Base&
_M_base() { return *this; }
const _Base&
_M_base() const { return *this; }
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(_M_base().end()));
}
};
template
inline void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
template
inline bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_equal(__y); }
template
inline bool
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
/// Class std::unordered_multimap with safety/checking/debug instrumentation.
template,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<_Key> >
class unordered_multimap
: public _GLIBCXX_STD_D::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc>,
public __gnu_debug::_Safe_sequence >
{
typedef _GLIBCXX_STD_D::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base;
typedef __gnu_debug::_Safe_sequence _Safe_base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
typedef __gnu_debug::_Safe_iterator iterator;
typedef __gnu_debug::_Safe_iterator const_iterator;
explicit
unordered_multimap(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a) { }
template
unordered_multimap(_InputIterator __f, _InputIterator __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
__hf, __eql, __a), _Safe_base() { }
unordered_multimap(const unordered_multimap& __x)
: _Base(__x), _Safe_base() { }
unordered_multimap(const _Base& __x)
: _Base(__x), _Safe_base() { }
unordered_multimap(unordered_multimap&& __x)
: _Base(std::forward(__x)), _Safe_base() { }
unordered_multimap(initializer_list __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
unordered_multimap&
operator=(const unordered_multimap& __x)
{
*static_cast<_Base*>(this) = __x;
this->_M_invalidate_all();
return *this;
}
unordered_multimap&
operator=(unordered_multimap&& __x)
{
// NB: DR 1204.
// NB: DR 675.
clear();
swap(__x);
return *this;
}
unordered_multimap&
operator=(initializer_list __l)
{
this->clear();
this->insert(__l);
return *this;
}
void
swap(unordered_multimap& __x)
{
_Base::swap(__x);
_Safe_base::_M_swap(__x);
}
void
clear()
{
_Base::clear();
this->_M_invalidate_all();
}
iterator
begin()
{ return iterator(_Base::begin(), this); }
const_iterator
begin() const
{ return const_iterator(_Base::begin(), this); }
iterator
end()
{ return iterator(_Base::end(), this); }
const_iterator
end() const
{ return const_iterator(_Base::end(), this); }
const_iterator
cbegin() const
{ return const_iterator(_Base::begin(), this); }
const_iterator
cend() const
{ return const_iterator(_Base::end(), this); }
// local versions
using _Base::begin;
using _Base::end;
using _Base::cbegin;
using _Base::cend;
iterator
insert(const value_type& __obj)
{ return iterator(_Base::insert(__obj), this); }
iterator
insert(const_iterator, const value_type& __obj)
{ return iterator(_Base::insert(__obj), this); }
void
insert(std::initializer_list __l)
{ _Base::insert(__l); }
template
void
insert(_InputIterator __first, _InputIterator __last)
{
__glibcxx_check_valid_range(__first, __last);
_Base::insert(__first, __last);
}
iterator
find(const key_type& __key)
{ return iterator(_Base::find(__key), this); }
const_iterator
find(const key_type& __key) const
{ return const_iterator(_Base::find(__key), this); }
std::pair
equal_range(const key_type& __key)
{
typedef typename _Base::iterator _Base_iterator;
typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
__pair_type __res = _Base::equal_range(__key);
return std::make_pair(iterator(__res.first, this),
iterator(__res.second, this));
}
std::pair
equal_range(const key_type& __key) const
{
typedef typename _Base::const_iterator _Base_iterator;
typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
__pair_type __res = _Base::equal_range(__key);
return std::make_pair(const_iterator(__res.first, this),
const_iterator(__res.second, this));
}
size_type
erase(const key_type& __key)
{
size_type __ret(0);
iterator __victim(_Base::find(__key), this);
if (__victim != end())
{
this->erase(__victim);
__ret = 1;
}
return __ret;
}
iterator
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
__it._M_invalidate();
return iterator(_Base::erase(__it.base()), this);
}
iterator
erase(const_iterator __first, const_iterator __last)
{
__glibcxx_check_erase_range(__first, __last);
for (const_iterator __tmp = __first; __tmp != __last;)
{
const_iterator __victim = __tmp++;
__victim._M_invalidate();
}
return iterator(_Base::erase(__first.base(),
__last.base()), this);
}
_Base&
_M_base() { return *this; }
const _Base&
_M_base() const { return *this; }
private:
void
_M_invalidate_all()
{
typedef typename _Base::const_iterator _Base_const_iterator;
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
this->_M_invalidate_if(_Not_equal(_M_base().end()));
}
};
template
inline void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
template
inline bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_equal(__y); }
template
inline bool
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
} // namespace __debug
} // namespace std
#endif // __GXX_EXPERIMENTAL_CXX0X__
#endif
@
1.1.1.1
log
@initial import of GCC 4.5.3 sources. changes since 4.1 are way too numerous
to review, please see http://gcc.gnu.org/gcc-4.5/changes.html (and the 4.2,
4.3 and 4.4 versions, too.)
this includes the core, c++, objc and the non java/ada/fortran parts of the
testsuite.
@
text
@@
1.1.1.1.8.1
log
@Rebase to HEAD as of a few days ago.
@
text
@d3 2
a4 1
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
d33 1
a33 1
#if __cplusplus < 201103L
d38 1
a38 1
#include
a39 1
#include
d41 1
a41 1
namespace std _GLIBCXX_VISIBILITY(default)
d51 3
a53 3
: public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
public __gnu_debug::_Safe_unordered_container >
d55 1
a55 1
typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
d57 1
a57 5
typedef __gnu_debug::_Safe_unordered_container _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d68 1
a68 1
typedef __gnu_debug::_Safe_iterator<_Base_iterator,
d70 1
a70 1
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
a71 4
typedef __gnu_debug::_Safe_local_iterator<_Base_local_iterator,
unordered_map> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<_Base_const_local_iterator,
unordered_map> const_local_iterator;
d81 2
a82 2
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
d86 2
a87 4
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
d89 2
a90 1
unordered_map(const unordered_map& __x) = default;
d93 1
a93 1
: _Base(__x) { }
d95 2
a96 1
unordered_map(unordered_map&& __x) = default;
d99 1
a99 1
size_type __n = 0,
d103 1
a103 3
: _Base(__l, __n, __hf, __eql, __a) { }
~unordered_map() noexcept { }
a117 1
__glibcxx_check_self_move_assign(__x);
d139 1
a139 1
clear() noexcept
d146 1
a146 1
begin() noexcept
d150 1
a150 1
begin() const noexcept
d154 1
a154 1
end() noexcept
d158 1
a158 1
end() const noexcept
d162 1
a162 1
cbegin() const noexcept
d166 1
a166 1
cend() const noexcept
d170 4
a173 82
local_iterator
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::begin(__b), __b, this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::begin(__b), __b, this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cbegin(__b), __b, this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cend(__b), __b, this);
}
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template
std::pair
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res
= _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d178 2
a179 3
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res = _Base::insert(__obj);
_M_check_rehashed(__bucket_count);
d184 1
a184 1
insert(const_iterator __hint, const value_type& __obj)
d186 3
a188 5
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
a190 27
template::value>::type>
std::pair
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res =
_Base::insert(std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it =
_Base::insert(__hint.base(), std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d193 1
a193 5
{
size_type __bucket_count = this->bucket_count();
_Base::insert(__l);
_M_check_rehashed(__bucket_count);
}
d196 3
a198 3
void
insert(_InputIterator __first, _InputIterator __last)
{
d200 1
a200 4
size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
_M_check_rehashed(__bucket_count);
d214 3
a216 2
std::pair<_Base_iterator, _Base_iterator> __res =
_Base::equal_range(__key);
d224 3
a226 2
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__key);
d235 2
a236 2
_Base_iterator __victim(_Base::find(__key));
if (__victim != _Base::end())
d238 1
a238 8
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base::erase(__victim);
_M_check_rehashed(__bucket_count);
d248 2
a249 10
_Base_const_iterator __victim = __it.base();
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__it.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
a252 4
erase(iterator __it)
{ return erase(const_iterator(__it)); }
iterator
d256 7
a262 17
for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp)
{
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
{ return __it == __tmp; });
this->_M_invalidate_local_if(
[__tmp](_Base_const_local_iterator __it)
{ return __it._M_cur == __tmp._M_cur; });
}
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__first.base(), __last.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
d266 1
a266 1
_M_base() noexcept { return *this; }
d269 1
a269 1
_M_base() const noexcept { return *this; }
a272 9
_M_invalidate_locals()
{
_Base_local_iterator __local_end = _Base::end(0);
this->_M_invalidate_local_if(
[__local_end](_Base_const_local_iterator __it)
{ return __it != __local_end; });
}
void
d275 3
a277 11
_Base_iterator __end = _Base::end();
this->_M_invalidate_if([__end](_Base_const_iterator __it)
{ return __it != __end; });
_M_invalidate_locals();
}
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
_M_invalidate_locals();
d293 1
a293 1
{ return __x._M_base() == __y._M_base(); }
d309 1
a309 1
: public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
d311 2
a312 2
public __gnu_debug::_Safe_unordered_container >
d314 1
a314 1
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
d316 1
a316 6
typedef __gnu_debug::_Safe_unordered_container
_Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d327 1
a327 1
typedef __gnu_debug::_Safe_iterator<_Base_iterator,
d329 1
a329 1
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
a330 4
typedef __gnu_debug::_Safe_local_iterator<
_Base_local_iterator, unordered_multimap> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_const_local_iterator, unordered_multimap> const_local_iterator;
d340 2
a341 2
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
d345 2
a346 4
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
d348 2
a349 1
unordered_multimap(const unordered_multimap& __x) = default;
d352 1
a352 1
: _Base(__x) { }
d354 2
a355 1
unordered_multimap(unordered_multimap&& __x) = default;
d358 1
a358 1
size_type __n = 0,
d362 1
a362 3
: _Base(__l, __n, __hf, __eql, __a) { }
~unordered_multimap() noexcept { }
a376 1
__glibcxx_check_self_move_assign(__x);
d398 1
a398 1
clear() noexcept
d405 1
a405 1
begin() noexcept
d409 1
a409 1
begin() const noexcept
d413 1
a413 1
end() noexcept
d417 1
a417 1
end() const noexcept
d421 1
a421 1
cbegin() const noexcept
d425 1
a425 1
cend() const noexcept
d429 4
a432 82
local_iterator
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::begin(__b), __b, this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::begin(__b), __b, this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cbegin(__b), __b, this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cend(__b), __b, this);
}
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template
iterator
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it
= _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d436 1
a436 6
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d439 2
a440 34
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template::value>::type>
iterator
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it =
_Base::insert(__hint.base(), std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d447 3
a449 3
void
insert(_InputIterator __first, _InputIterator __last)
{
d451 1
a451 4
size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
_M_check_rehashed(__bucket_count);
d465 3
a467 2
std::pair<_Base_iterator, _Base_iterator> __res =
_Base::equal_range(__key);
d475 3
a477 2
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__key);
d486 2
a487 4
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, _Base_iterator> __pair =
_Base::equal_range(__key);
for (_Base_iterator __victim = __pair.first; __victim != __pair.second;)
d489 2
a490 7
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
_Base::erase(__victim++);
++__ret;
a491 1
_M_check_rehashed(__bucket_count);
d499 2
a500 10
_Base_const_iterator __victim = __it.base();
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__it.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
a503 4
erase(iterator __it)
{ return erase(const_iterator(__it)); }
iterator
d507 7
a513 17
for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp)
{
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
{ return __it == __tmp; });
this->_M_invalidate_local_if(
[__tmp](_Base_const_local_iterator __it)
{ return __it._M_cur == __tmp._M_cur; });
}
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__first.base(), __last.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
d517 1
a517 1
_M_base() noexcept { return *this; }
d520 1
a520 1
_M_base() const noexcept { return *this; }
a523 9
_M_invalidate_locals()
{
_Base_local_iterator __local_end = _Base::end(0);
this->_M_invalidate_local_if(
[__local_end](_Base_const_local_iterator __it)
{ return __it != __local_end; });
}
void
d526 3
a528 11
_Base_iterator __end = _Base::end();
this->_M_invalidate_if([__end](_Base_const_iterator __it)
{ return __it != __end; });
_M_invalidate_locals();
}
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
_M_invalidate_locals();
d544 1
a544 1
{ return __x._M_base() == __y._M_base(); }
d556 1
a556 1
#endif // C++11
@
1.1.1.1.2.1
log
@sync with head.
for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
@
text
@d3 2
a4 1
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
d33 1
a33 1
#if __cplusplus < 201103L
d38 1
a38 1
#include
a39 1
#include
d41 1
a41 1
namespace std _GLIBCXX_VISIBILITY(default)
d51 3
a53 3
: public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
public __gnu_debug::_Safe_unordered_container >
d55 1
a55 1
typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
d57 1
a57 5
typedef __gnu_debug::_Safe_unordered_container _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d68 1
a68 1
typedef __gnu_debug::_Safe_iterator<_Base_iterator,
d70 1
a70 1
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
a71 4
typedef __gnu_debug::_Safe_local_iterator<_Base_local_iterator,
unordered_map> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<_Base_const_local_iterator,
unordered_map> const_local_iterator;
d81 2
a82 2
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
d86 2
a87 4
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
d89 2
a90 1
unordered_map(const unordered_map& __x) = default;
d93 1
a93 1
: _Base(__x) { }
d95 2
a96 1
unordered_map(unordered_map&& __x) = default;
d99 1
a99 1
size_type __n = 0,
d103 1
a103 3
: _Base(__l, __n, __hf, __eql, __a) { }
~unordered_map() noexcept { }
a117 1
__glibcxx_check_self_move_assign(__x);
d139 1
a139 1
clear() noexcept
d146 1
a146 1
begin() noexcept
d150 1
a150 1
begin() const noexcept
d154 1
a154 1
end() noexcept
d158 1
a158 1
end() const noexcept
d162 1
a162 1
cbegin() const noexcept
d166 1
a166 1
cend() const noexcept
d170 4
a173 82
local_iterator
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::begin(__b), __b, this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::begin(__b), __b, this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cbegin(__b), __b, this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cend(__b), __b, this);
}
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template
std::pair
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res
= _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d178 2
a179 3
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res = _Base::insert(__obj);
_M_check_rehashed(__bucket_count);
d184 1
a184 1
insert(const_iterator __hint, const value_type& __obj)
d186 3
a188 5
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
a190 27
template::value>::type>
std::pair
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res =
_Base::insert(std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it =
_Base::insert(__hint.base(), std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d193 1
a193 5
{
size_type __bucket_count = this->bucket_count();
_Base::insert(__l);
_M_check_rehashed(__bucket_count);
}
d196 3
a198 3
void
insert(_InputIterator __first, _InputIterator __last)
{
d200 1
a200 4
size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
_M_check_rehashed(__bucket_count);
d214 3
a216 2
std::pair<_Base_iterator, _Base_iterator> __res =
_Base::equal_range(__key);
d224 3
a226 2
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__key);
d235 2
a236 2
_Base_iterator __victim(_Base::find(__key));
if (__victim != _Base::end())
d238 1
a238 8
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base::erase(__victim);
_M_check_rehashed(__bucket_count);
d248 2
a249 10
_Base_const_iterator __victim = __it.base();
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__it.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
a252 4
erase(iterator __it)
{ return erase(const_iterator(__it)); }
iterator
d256 7
a262 17
for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp)
{
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
{ return __it == __tmp; });
this->_M_invalidate_local_if(
[__tmp](_Base_const_local_iterator __it)
{ return __it._M_cur == __tmp._M_cur; });
}
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__first.base(), __last.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
d266 1
a266 1
_M_base() noexcept { return *this; }
d269 1
a269 1
_M_base() const noexcept { return *this; }
a272 9
_M_invalidate_locals()
{
_Base_local_iterator __local_end = _Base::end(0);
this->_M_invalidate_local_if(
[__local_end](_Base_const_local_iterator __it)
{ return __it != __local_end; });
}
void
d275 3
a277 11
_Base_iterator __end = _Base::end();
this->_M_invalidate_if([__end](_Base_const_iterator __it)
{ return __it != __end; });
_M_invalidate_locals();
}
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
_M_invalidate_locals();
d293 1
a293 1
{ return __x._M_base() == __y._M_base(); }
d309 1
a309 1
: public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
d311 2
a312 2
public __gnu_debug::_Safe_unordered_container >
d314 1
a314 1
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
d316 1
a316 6
typedef __gnu_debug::_Safe_unordered_container
_Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d327 1
a327 1
typedef __gnu_debug::_Safe_iterator<_Base_iterator,
d329 1
a329 1
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
a330 4
typedef __gnu_debug::_Safe_local_iterator<
_Base_local_iterator, unordered_multimap> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_const_local_iterator, unordered_multimap> const_local_iterator;
d340 2
a341 2
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
d345 2
a346 4
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
d348 2
a349 1
unordered_multimap(const unordered_multimap& __x) = default;
d352 1
a352 1
: _Base(__x) { }
d354 2
a355 1
unordered_multimap(unordered_multimap&& __x) = default;
d358 1
a358 1
size_type __n = 0,
d362 1
a362 3
: _Base(__l, __n, __hf, __eql, __a) { }
~unordered_multimap() noexcept { }
a376 1
__glibcxx_check_self_move_assign(__x);
d398 1
a398 1
clear() noexcept
d405 1
a405 1
begin() noexcept
d409 1
a409 1
begin() const noexcept
d413 1
a413 1
end() noexcept
d417 1
a417 1
end() const noexcept
d421 1
a421 1
cbegin() const noexcept
d425 1
a425 1
cend() const noexcept
d429 4
a432 82
local_iterator
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::begin(__b), __b, this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::begin(__b), __b, this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cbegin(__b), __b, this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cend(__b), __b, this);
}
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template
iterator
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it
= _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d436 1
a436 6
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d439 2
a440 34
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template::value>::type>
iterator
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it =
_Base::insert(__hint.base(), std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d447 3
a449 3
void
insert(_InputIterator __first, _InputIterator __last)
{
d451 1
a451 4
size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
_M_check_rehashed(__bucket_count);
d465 3
a467 2
std::pair<_Base_iterator, _Base_iterator> __res =
_Base::equal_range(__key);
d475 3
a477 2
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__key);
d486 2
a487 4
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, _Base_iterator> __pair =
_Base::equal_range(__key);
for (_Base_iterator __victim = __pair.first; __victim != __pair.second;)
d489 2
a490 7
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
_Base::erase(__victim++);
++__ret;
a491 1
_M_check_rehashed(__bucket_count);
d499 2
a500 10
_Base_const_iterator __victim = __it.base();
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__it.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
a503 4
erase(iterator __it)
{ return erase(const_iterator(__it)); }
iterator
d507 7
a513 17
for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp)
{
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
{ return __it == __tmp; });
this->_M_invalidate_local_if(
[__tmp](_Base_const_local_iterator __it)
{ return __it._M_cur == __tmp._M_cur; });
}
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__first.base(), __last.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
d517 1
a517 1
_M_base() noexcept { return *this; }
d520 1
a520 1
_M_base() const noexcept { return *this; }
a523 9
_M_invalidate_locals()
{
_Base_local_iterator __local_end = _Base::end(0);
this->_M_invalidate_local_if(
[__local_end](_Base_const_local_iterator __it)
{ return __it != __local_end; });
}
void
d526 3
a528 11
_Base_iterator __end = _Base::end();
this->_M_invalidate_if([__end](_Base_const_iterator __it)
{ return __it != __end; });
_M_invalidate_locals();
}
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
_M_invalidate_locals();
d544 1
a544 1
{ return __x._M_base() == __y._M_base(); }
d556 1
a556 1
#endif // C++11
@
1.1.1.2
log
@import GCC 4.8 branch at r206687.
highlights from: http://gcc.gnu.org/gcc-4.6/changes.html
GCC now has stricter checks for invalid command-line options
New -Wunused-but-set-variable and -Wunused-but-set-parameter
warnings
Many platforms have been obsoleted
Link-time optimization improvements
A new switch -fstack-usage has been added
A new function attribute leaf was introduced
A new warning, enabled by -Wdouble-promotion
Support for selectively enabling and disabling warnings via
#pragma GCC diagnostic has been added
There is now experimental support for some features from the
upcoming C1X revision of the ISO C standard
Improved experimental support for the upcoming C++0x ISO C++
standard
G++ now issues clearer diagnostics in several cases
Updates for ARM, x86, MIPS, PPC/PPC64, SPARC
Darwin, FreeBSD, Solaris 2, MinGW and Cygwin now all support
__float128 on 32-bit and 64-bit x86 targets. [*1]
highlights from: http://gcc.gnu.org/gcc-4.7/changes.html
The -fconserve-space flag has been deprecated
Support for a new parameter --param case-values-threshold=n
was added
Interprocedural and Link-time optimization improvements
A new built-in, __builtin_assume_aligned, has been added
A new warning option -Wunused-local-typedefs was added
A new experimental command-line option -ftrack-macro-expansion
was added
Support for atomic operations specifying the C++11/C11 memory
model has been added
There is support for some more features from the C11 revision
of the ISO C standard
Improved experimental support for the new ISO C++ standard,
C++11
Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE*
A new option (-grecord-gcc-switches) was added
highlights from: http://gcc.gnu.org/gcc-4.8/changes.html
GCC now uses C++ as its implementation language. This means
that to build GCC from sources, you will need a C++
compiler that understands C++ 2003
DWARF4 is now the default when generating DWARF debug
information
A new general optimization level, -Og, has been introduced
A new option -ftree-partial-pre was added
The option -fconserve-space has been removed
The command-line options -fipa-struct-reorg and
-fipa-matrix-reorg have been removed
Interprocedural and Link-time optimization improvements
AddressSanitizer, a fast memory error detector, has been
added [*2]
A new -Wsizeof-pointer-memaccess warning has been added
G++ now supports a -std=c++1y option for experimentation
with features proposed for the next revision of the
standard, expected around 2014
Improved experimental support for the new ISO C++ standard,
C++11
A new port has been added to support AArch64
Updates for ARM, x86, MIPS, PPC/PPC64, SH, SPARC, TILE*
[*1] we should support this too!
[*2] we should look into this.
https://code.google.com/p/address-sanitizer/
@
text
@d3 2
a4 1
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
d33 1
a33 1
#if __cplusplus < 201103L
d38 1
a38 1
#include
a39 1
#include
d41 1
a41 1
namespace std _GLIBCXX_VISIBILITY(default)
d51 3
a53 3
: public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
public __gnu_debug::_Safe_unordered_container >
d55 1
a55 1
typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
d57 1
a57 5
typedef __gnu_debug::_Safe_unordered_container _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d68 1
a68 1
typedef __gnu_debug::_Safe_iterator<_Base_iterator,
d70 1
a70 1
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
a71 4
typedef __gnu_debug::_Safe_local_iterator<_Base_local_iterator,
unordered_map> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<_Base_const_local_iterator,
unordered_map> const_local_iterator;
d81 2
a82 2
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
d86 2
a87 4
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
d89 2
a90 1
unordered_map(const unordered_map& __x) = default;
d93 1
a93 1
: _Base(__x) { }
d95 2
a96 1
unordered_map(unordered_map&& __x) = default;
d99 1
a99 1
size_type __n = 0,
d103 1
a103 3
: _Base(__l, __n, __hf, __eql, __a) { }
~unordered_map() noexcept { }
a117 1
__glibcxx_check_self_move_assign(__x);
d139 1
a139 1
clear() noexcept
d146 1
a146 1
begin() noexcept
d150 1
a150 1
begin() const noexcept
d154 1
a154 1
end() noexcept
d158 1
a158 1
end() const noexcept
d162 1
a162 1
cbegin() const noexcept
d166 1
a166 1
cend() const noexcept
d170 4
a173 82
local_iterator
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::begin(__b), __b, this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::begin(__b), __b, this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cbegin(__b), __b, this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cend(__b), __b, this);
}
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template
std::pair
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res
= _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d178 2
a179 3
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res = _Base::insert(__obj);
_M_check_rehashed(__bucket_count);
d184 1
a184 1
insert(const_iterator __hint, const value_type& __obj)
d186 3
a188 5
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
a190 27
template::value>::type>
std::pair
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, bool> __res =
_Base::insert(std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return std::make_pair(iterator(__res.first, this), __res.second);
}
template::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it =
_Base::insert(__hint.base(), std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d193 1
a193 5
{
size_type __bucket_count = this->bucket_count();
_Base::insert(__l);
_M_check_rehashed(__bucket_count);
}
d196 3
a198 3
void
insert(_InputIterator __first, _InputIterator __last)
{
d200 1
a200 4
size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
_M_check_rehashed(__bucket_count);
d214 3
a216 2
std::pair<_Base_iterator, _Base_iterator> __res =
_Base::equal_range(__key);
d224 3
a226 2
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__key);
d235 2
a236 2
_Base_iterator __victim(_Base::find(__key));
if (__victim != _Base::end())
d238 1
a238 8
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base::erase(__victim);
_M_check_rehashed(__bucket_count);
d248 2
a249 10
_Base_const_iterator __victim = __it.base();
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__it.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
a252 4
erase(iterator __it)
{ return erase(const_iterator(__it)); }
iterator
d256 7
a262 17
for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp)
{
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
{ return __it == __tmp; });
this->_M_invalidate_local_if(
[__tmp](_Base_const_local_iterator __it)
{ return __it._M_cur == __tmp._M_cur; });
}
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__first.base(), __last.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
d266 1
a266 1
_M_base() noexcept { return *this; }
d269 1
a269 1
_M_base() const noexcept { return *this; }
a272 9
_M_invalidate_locals()
{
_Base_local_iterator __local_end = _Base::end(0);
this->_M_invalidate_local_if(
[__local_end](_Base_const_local_iterator __it)
{ return __it != __local_end; });
}
void
d275 3
a277 11
_Base_iterator __end = _Base::end();
this->_M_invalidate_if([__end](_Base_const_iterator __it)
{ return __it != __end; });
_M_invalidate_locals();
}
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
_M_invalidate_locals();
d293 1
a293 1
{ return __x._M_base() == __y._M_base(); }
d309 1
a309 1
: public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
d311 2
a312 2
public __gnu_debug::_Safe_unordered_container >
d314 1
a314 1
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
d316 1
a316 6
typedef __gnu_debug::_Safe_unordered_container
_Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d327 1
a327 1
typedef __gnu_debug::_Safe_iterator<_Base_iterator,
d329 1
a329 1
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
a330 4
typedef __gnu_debug::_Safe_local_iterator<
_Base_local_iterator, unordered_multimap> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_const_local_iterator, unordered_multimap> const_local_iterator;
d340 2
a341 2
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n = 0,
d345 2
a346 4
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
d348 2
a349 1
unordered_multimap(const unordered_multimap& __x) = default;
d352 1
a352 1
: _Base(__x) { }
d354 2
a355 1
unordered_multimap(unordered_multimap&& __x) = default;
d358 1
a358 1
size_type __n = 0,
d362 1
a362 3
: _Base(__l, __n, __hf, __eql, __a) { }
~unordered_multimap() noexcept { }
a376 1
__glibcxx_check_self_move_assign(__x);
d398 1
a398 1
clear() noexcept
d405 1
a405 1
begin() noexcept
d409 1
a409 1
begin() const noexcept
d413 1
a413 1
end() noexcept
d417 1
a417 1
end() const noexcept
d421 1
a421 1
cbegin() const noexcept
d425 1
a425 1
cend() const noexcept
d429 4
a432 82
local_iterator
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::begin(__b), __b, this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
return local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::begin(__b), __b, this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::end(__b), __b, this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cbegin(__b), __b, this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return const_local_iterator(_Base::cend(__b), __b, this);
}
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template
iterator
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it
= _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d436 1
a436 6
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d439 2
a440 34
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template::value>::type>
iterator
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
template::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it =
_Base::insert(__hint.base(), std::forward<_Pair>(__obj));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d447 3
a449 3
void
insert(_InputIterator __first, _InputIterator __last)
{
d451 1
a451 4
size_type __bucket_count = this->bucket_count();
_Base::insert(__gnu_debug::__base(__first),
__gnu_debug::__base(__last));
_M_check_rehashed(__bucket_count);
d465 3
a467 2
std::pair<_Base_iterator, _Base_iterator> __res =
_Base::equal_range(__key);
d475 3
a477 2
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
_Base::equal_range(__key);
d486 2
a487 4
size_type __bucket_count = this->bucket_count();
std::pair<_Base_iterator, _Base_iterator> __pair =
_Base::equal_range(__key);
for (_Base_iterator __victim = __pair.first; __victim != __pair.second;)
d489 2
a490 7
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
_Base::erase(__victim++);
++__ret;
a491 1
_M_check_rehashed(__bucket_count);
d499 2
a500 10
_Base_const_iterator __victim = __it.base();
this->_M_invalidate_if([__victim](_Base_const_iterator __it)
{ return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_cur == __victim._M_cur; });
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__it.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
a503 4
erase(iterator __it)
{ return erase(const_iterator(__it)); }
iterator
d507 7
a513 17
for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp)
{
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
this->_M_invalidate_if([__tmp](_Base_const_iterator __it)
{ return __it == __tmp; });
this->_M_invalidate_local_if(
[__tmp](_Base_const_local_iterator __it)
{ return __it._M_cur == __tmp._M_cur; });
}
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__first.base(), __last.base());
_M_check_rehashed(__bucket_count);
return iterator(__next, this);
d517 1
a517 1
_M_base() noexcept { return *this; }
d520 1
a520 1
_M_base() const noexcept { return *this; }
a523 9
_M_invalidate_locals()
{
_Base_local_iterator __local_end = _Base::end(0);
this->_M_invalidate_local_if(
[__local_end](_Base_const_local_iterator __it)
{ return __it != __local_end; });
}
void
d526 3
a528 11
_Base_iterator __end = _Base::end();
this->_M_invalidate_if([__end](_Base_const_iterator __it)
{ return __it != __end; });
_M_invalidate_locals();
}
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
_M_invalidate_locals();
d544 1
a544 1
{ return __x._M_base() == __y._M_base(); }
d556 1
a556 1
#endif // C++11
@
1.1.1.3
log
@import GCC 5.3.0. see these urls for details which are too large to
include here:
http://gcc.gnu.org/gcc-4.9/changes.html
http://gcc.gnu.org/gcc-5/changes.html
(note that GCC 5.x is a release stream like GCC 4.9.x, 4.8.x, etc.)
the main issues we will have are:
The default mode for C is now -std=gnu11 instead of -std=gnu89.
ARM:
The deprecated option -mwords-little-endian has been removed.
The options -mapcs, -mapcs-frame, -mtpcs-frame and -mtpcs-leaf-frame
which are only applicable to the old ABI have been deprecated.
MIPS:
The o32 ABI has been modified and extended. The o32 64-bit
floating-point register support is now obsolete and has been removed.
It has been replaced by three ABI extensions FPXX, FP64A, and FP64.
The meaning of the -mfp64 command-line option has changed. It is now
used to enable the FP64A and FP64 ABI extensions.
@
text
@d3 1
a3 1
// Copyright (C) 2003-2015 Free Software Foundation, Inc.
a37 1
#include
d49 1
a49 1
typename _Alloc = std::allocator > >
d51 3
a53 4
: public __gnu_debug::_Safe_container<
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
__gnu_debug::_Safe_unordered_container>,
public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
d56 6
a61 8
_Pred, _Alloc> _Base;
typedef __gnu_debug::_Safe_container _Safe;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator
_Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
d64 16
a79 18
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
typedef __gnu_debug::_Safe_iterator<
_Base_iterator, unordered_map> iterator;
typedef __gnu_debug::_Safe_iterator<
_Base_const_iterator, unordered_map> const_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_local_iterator, unordered_map> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_const_local_iterator, unordered_map> const_local_iterator;
unordered_map() = default;
d82 1
a82 1
unordered_map(size_type __n,
d89 1
a89 1
unordered_map(_InputIterator __first, _InputIterator __last,
d91 2
a92 2
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
d99 1
a99 1
unordered_map(const unordered_map&) = default;
d104 1
a104 14
unordered_map(unordered_map&&) = default;
explicit
unordered_map(const allocator_type& __a)
: _Base(__a) { }
unordered_map(const unordered_map& __umap,
const allocator_type& __a)
: _Base(__umap, __a) { }
unordered_map(unordered_map&& __umap,
const allocator_type& __a)
: _Safe(std::move(__umap._M_safe()), __a),
_Base(std::move(__umap._M_base()), __a) { }
d113 1
a113 39
unordered_map(size_type __n, const allocator_type& __a)
: unordered_map(__n, hasher(), key_equal(), __a)
{ }
unordered_map(size_type __n,
const hasher& __hf,
const allocator_type& __a)
: unordered_map(__n, __hf, key_equal(), __a)
{ }
template
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n,
const allocator_type& __a)
: unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
{ }
template
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n,
const hasher& __hf,
const allocator_type& __a)
: unordered_map(__first, __last, __n, __hf, key_equal(), __a)
{ }
unordered_map(initializer_list __l,
size_type __n,
const allocator_type& __a)
: unordered_map(__l, __n, hasher(), key_equal(), __a)
{ }
unordered_map(initializer_list __l,
size_type __n,
const hasher& __hf,
const allocator_type& __a)
: unordered_map(__l, __n, __hf, key_equal(), __a)
{ }
~unordered_map() = default;
d116 6
a121 1
operator=(const unordered_map&) = default;
d124 9
a132 1
operator=(unordered_map&&) = default;
d137 2
a138 2
_M_base() = __l;
this->_M_invalidate_all();
a143 1
noexcept( noexcept(declval<_Base>().swap(__x)) )
a144 1
_Safe::_M_swap(__x);
d146 1
d156 1
a156 1
iterator
d185 1
a185 1
return local_iterator(_Base::begin(__b), this);
d192 1
a192 1
return local_iterator(_Base::end(__b), this);
d199 1
a199 1
return const_local_iterator(_Base::begin(__b), this);
d206 1
a206 1
return const_local_iterator(_Base::end(__b), this);
d213 1
a213 1
return const_local_iterator(_Base::cbegin(__b), this);
d220 1
a220 1
return const_local_iterator(_Base::cend(__b), this);
d278 1
a278 1
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
d325 1
a325 1
__gnu_debug::__base(__last));
d366 1
a366 1
{ return __it._M_curr() == __victim._M_cur; });
d384 1
a384 1
{ return __it._M_curr() == __victim._M_cur; });
d386 1
a386 1
_Base_iterator __next = _Base::erase(__it.base());
d410 1
a410 1
{ return __it._M_curr() == __tmp._M_cur; });
d419 1
a419 1
_M_base() noexcept { return *this; }
d422 1
a422 1
_M_base() const noexcept { return *this; }
d426 18
d447 1
a447 1
this->_M_invalidate_locals();
d477 1
a477 1
typename _Alloc = std::allocator > >
d479 4
a482 4
: public __gnu_debug::_Safe_container<
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
__gnu_debug::_Safe_unordered_container>,
public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
d485 5
a489 5
_Pred, _Alloc> _Base;
typedef __gnu_debug::_Safe_container _Safe;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
d491 1
a491 1
typedef typename _Base::local_iterator _Base_local_iterator;
d494 12
a505 12
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
typedef __gnu_debug::_Safe_iterator<
_Base_iterator, unordered_multimap> iterator;
typedef __gnu_debug::_Safe_iterator<
_Base_const_iterator, unordered_multimap> const_iterator;
d507 1
a507 1
_Base_local_iterator, unordered_multimap> local_iterator;
a510 2
unordered_multimap() = default;
d512 1
a512 1
unordered_multimap(size_type __n,
d519 1
a519 1
unordered_multimap(_InputIterator __first, _InputIterator __last,
d521 2
a522 2
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
d529 1
a529 1
unordered_multimap(const unordered_multimap&) = default;
d531 1
a531 1
unordered_multimap(const _Base& __x)
d534 1
a534 14
unordered_multimap(unordered_multimap&&) = default;
explicit
unordered_multimap(const allocator_type& __a)
: _Base(__a) { }
unordered_multimap(const unordered_multimap& __umap,
const allocator_type& __a)
: _Base(__umap, __a) { }
unordered_multimap(unordered_multimap&& __umap,
const allocator_type& __a)
: _Safe(std::move(__umap._M_safe()), __a),
_Base(std::move(__umap._M_base()), __a) { }
d543 1
a543 36
unordered_multimap(size_type __n, const allocator_type& __a)
: unordered_multimap(__n, hasher(), key_equal(), __a)
{ }
unordered_multimap(size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__n, __hf, key_equal(), __a)
{ }
template
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n,
const allocator_type& __a)
: unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
{ }
template
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
{ }
unordered_multimap(initializer_list __l,
size_type __n,
const allocator_type& __a)
: unordered_multimap(__l, __n, hasher(), key_equal(), __a)
{ }
unordered_multimap(initializer_list __l,
size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__l, __n, __hf, key_equal(), __a)
{ }
~unordered_multimap() = default;
d546 6
a551 1
operator=(const unordered_multimap&) = default;
d554 9
a562 1
operator=(unordered_multimap&&) = default;
d567 2
a568 2
this->_M_base() = __l;
this->_M_invalidate_all();
a573 1
noexcept( noexcept(declval<_Base>().swap(__x)) )
a574 1
_Safe::_M_swap(__x);
d576 1
d586 1
a586 1
iterator
d615 1
a615 1
return local_iterator(_Base::begin(__b), this);
d622 1
a622 1
return local_iterator(_Base::end(__b), this);
d629 1
a629 1
return const_local_iterator(_Base::begin(__b), this);
d636 1
a636 1
return const_local_iterator(_Base::end(__b), this);
d643 1
a643 1
return const_local_iterator(_Base::cbegin(__b), this);
d650 1
a650 1
return const_local_iterator(_Base::cend(__b), this);
d793 1
a793 1
{ return __it._M_curr() == __victim._M_cur; });
d810 1
a810 1
{ return __it._M_curr() == __victim._M_cur; });
d836 1
a836 1
{ return __it._M_curr() == __tmp._M_cur; });
d845 1
a845 1
_M_base() noexcept { return *this; }
d852 18
d873 1
a873 1
this->_M_invalidate_locals();
@
1.1.1.4
log
@import GCC 6.4.0. see this url for details which are too large to
include here:
http://gcc.gnu.org/gcc-6/changes.html
the main visible changes appear to be:
- The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98.
- The C and C++ compilers now support attributes on enumerators.
- Diagnostics can now contain "fix-it hints"
- more warnings (some added to -Wall)
@
text
@d3 1
a3 1
// Copyright (C) 2003-2016 Free Software Foundation, Inc.
d188 1
a188 1
noexcept( noexcept(declval<_Base&>().swap(__x)) )
d367 1
a367 2
typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
__glibcxx_check_valid_range2(__first, __last, __dist);
d369 2
a370 7
if (__dist.second >= __gnu_debug::__dp_sign)
_Base::insert(__gnu_debug::__unsafe(__first),
__gnu_debug::__unsafe(__last));
else
_Base::insert(__first, __last);
a373 82
#if __cplusplus > 201402L
template
pair
try_emplace(const key_type& __k, _Args&&... __args)
{
auto __res = _Base::try_emplace(__k,
std::forward<_Args>(__args)...);
return { iterator(__res.first, this), __res.second };
}
template
pair
try_emplace(key_type&& __k, _Args&&... __args)
{
auto __res = _Base::try_emplace(std::move(__k),
std::forward<_Args>(__args)...);
return { iterator(__res.first, this), __res.second };
}
template
iterator
try_emplace(const_iterator __hint, const key_type& __k,
_Args&&... __args)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::try_emplace(__hint.base(), __k,
std::forward<_Args>(__args)...),
this);
}
template
iterator
try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::try_emplace(__hint.base(), std::move(__k),
std::forward<_Args>(__args)...),
this);
}
template
pair
insert_or_assign(const key_type& __k, _Obj&& __obj)
{
auto __res = _Base::insert_or_assign(__k,
std::forward<_Obj>(__obj));
return { iterator(__res.first, this), __res.second };
}
template
pair
insert_or_assign(key_type&& __k, _Obj&& __obj)
{
auto __res = _Base::insert_or_assign(std::move(__k),
std::forward<_Obj>(__obj));
return { iterator(__res.first, this), __res.second };
}
template
iterator
insert_or_assign(const_iterator __hint, const key_type& __k,
_Obj&& __obj)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert_or_assign(__hint.base(), __k,
std::forward<_Obj>(__obj)),
this);
}
template
iterator
insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert_or_assign(__hint.base(),
std::move(__k),
std::forward<_Obj>(__obj)),
this);
}
#endif
a482 1
noexcept(noexcept(__x.swap(__y)))
d638 1
a638 1
noexcept( noexcept(declval<_Base&>().swap(__x)) )
d812 1
a812 2
typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
__glibcxx_check_valid_range2(__first, __last, __dist);
d814 2
a815 7
if (__dist.second >= __gnu_debug::__dp_sign)
_Base::insert(__gnu_debug::__unsafe(__first),
__gnu_debug::__unsafe(__last));
else
_Base::insert(__first, __last);
a928 1
noexcept(noexcept(__x.swap(__y)))
@
1.1.1.4.4.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
// Copyright (C) 2003-2017 Free Software Foundation, Inc.
a31 2
#pragma GCC system_header
d313 1
a313 1
auto __res = _Base::insert(__obj);
d315 1
a315 1
return { iterator(__res.first, this), __res.second };
d318 2
a319 4
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
std::pair
insert(value_type&& __x)
d321 1
d323 1
a323 1
auto __res = _Base::insert(std::move(__x));
d325 1
a325 1
return { iterator(__res.first, this), __res.second };
a340 22
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d459 1
a459 4
#endif // C++17
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
a460 48
struct insert_return_type
{
bool inserted;
iterator position;
node_type node;
};
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
_Base_const_iterator __victim = __position.base();
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; }
);
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it) {
return __it._M_curr() == __victim._M_cur;
});
return _Base::extract(__position.base());
}
node_type
extract(const key_type& __key)
{
const auto __position = find(__key);
if (__position != end())
return extract(__position);
return {};
}
insert_return_type
insert(node_type&& __nh)
{
auto __ret = _Base::insert(std::move(__nh));
iterator __pos = iterator(__ret.position, this);
return { __ret.inserted, __pos, std::move(__ret.node) };
}
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
}
using _Base::merge;
#endif // C++17
a856 11
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(value_type&& __x)
{
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(std::move(__x));
_M_check_rehashed(__bucket_count);
return { __it, this };
}
a866 12
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
a913 41
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
_Base_const_iterator __victim = __position.base();
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; }
);
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it) {
return __it._M_curr() == __victim._M_cur;
});
return _Base::extract(__position.base());
}
node_type
extract(const key_type& __key)
{
const auto __position = find(__key);
if (__position != end())
return extract(__position);
return {};
}
iterator
insert(node_type&& __nh)
{ return iterator(_Base::insert(std::move(__nh)), this); }
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
}
using _Base::merge;
#endif // C++17
@
1.1.1.4.4.2
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d3 1
a3 1
// Copyright (C) 2003-2018 Free Software Foundation, Inc.
d488 7
a494 1
using insert_return_type = _Node_insert_return;
d525 1
a525 1
return { __pos, __ret.inserted, std::move(__ret.node) };
a641 76
#if __cpp_deduction_guides >= 201606
template>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
_Hash, _Pred, _Allocator>;
template,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list>,
typename unordered_map::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type,
_Hash, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template>
unordered_map(initializer_list>,
typename unordered_map::size_type,
_Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_map(initializer_list>, _Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_map(initializer_list>,
typename unordered_map::size_type,
_Hash, _Allocator)
-> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
a1158 76
#if __cpp_deduction_guides >= 201606
template>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash, _Pred,
_Allocator>;
template,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list>,
unordered_multimap::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type, _Hash,
_Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template>
unordered_multimap(initializer_list>,
unordered_multimap::size_type,
_Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_multimap(initializer_list>, _Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_multimap(initializer_list>,
unordered_multimap::size_type,
_Hash, _Allocator)
-> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
@
1.1.1.4.2.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
// Copyright (C) 2003-2017 Free Software Foundation, Inc.
a31 2
#pragma GCC system_header
d313 1
a313 1
auto __res = _Base::insert(__obj);
d315 1
a315 1
return { iterator(__res.first, this), __res.second };
d318 2
a319 4
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
std::pair
insert(value_type&& __x)
d321 1
d323 1
a323 1
auto __res = _Base::insert(std::move(__x));
d325 1
a325 1
return { iterator(__res.first, this), __res.second };
a340 22
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d459 1
a459 4
#endif // C++17
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
a460 48
struct insert_return_type
{
bool inserted;
iterator position;
node_type node;
};
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
_Base_const_iterator __victim = __position.base();
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; }
);
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it) {
return __it._M_curr() == __victim._M_cur;
});
return _Base::extract(__position.base());
}
node_type
extract(const key_type& __key)
{
const auto __position = find(__key);
if (__position != end())
return extract(__position);
return {};
}
insert_return_type
insert(node_type&& __nh)
{
auto __ret = _Base::insert(std::move(__nh));
iterator __pos = iterator(__ret.position, this);
return { __ret.inserted, __pos, std::move(__ret.node) };
}
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
}
using _Base::merge;
#endif // C++17
a856 11
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(value_type&& __x)
{
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(std::move(__x));
_M_check_rehashed(__bucket_count);
return { __it, this };
}
a866 12
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
a913 41
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
_Base_const_iterator __victim = __position.base();
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; }
);
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it) {
return __it._M_curr() == __victim._M_cur;
});
return _Base::extract(__position.base());
}
node_type
extract(const key_type& __key)
{
const auto __position = find(__key);
if (__position != end())
return extract(__position);
return {};
}
iterator
insert(node_type&& __nh)
{ return iterator(_Base::insert(std::move(__nh)), this); }
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
}
using _Base::merge;
#endif // C++17
@
1.1.1.5
log
@import GCC 7.4.0. main changes include:
The non-standard C++0x type traits has_trivial_default_constructor,
has_trivial_copy_constructor and has_trivial_copy_assign have been
removed.
On ARM targets (arm*-*-*), a bug introduced in GCC 5 that affects
conformance to the procedure call standard (AAPCS) has been fixed.
Many optimiser improvements
DWARF-5 support.
Many new and enhanced warnings.
Warnings about format strings now underline the pertinent part of
the string, and can offer suggested fixes.
Several new warnings related to buffer overflows and buffer
truncation.
New __builtin_add_overflow_p, __builtin_sub_overflow_p,
__builtin_mul_overflow_p built-ins added that test for overflow.
The C++ front end has experimental support for all of the current
C++17 draft.
The -fverbose-asm option has been expanded to prints comments
showing the source lines that correspond to the assembly.
The gcc and g++ driver programs will now provide suggestions for
misspelled arguments to command-line options.
AArch64 specific:
GCC has been updated to the latest revision of the procedure call
standard (AAPCS64) to provide support for parameter passing when
data types have been over-aligned.
The ARMv8.2-A and ARMv8.3-A architecture are now supported.
ARM specific:
Support for the ARMv5 and ARMv5E architectures has been
deprecated (which have no known implementations).
A new command-line option -mpure-code has been added. It does not
allow constant data to be placed in code sections.
x86 specific:
Support for the AVX-512 4FMAPS, 4VNNIW, VPOPCNTDQ and Software
Guard Extensions (SGX) ISA extensions has been added.
PPC specific:
GCC now diagnoses inline assembly that clobbers register r2.
RISC-V specific:
Support for the RISC-V instruction set has been added.
SH specific:
Support for SH5/SH64 has been removed.
Support for SH2A has been enhanced.
@
text
@d3 1
a3 1
// Copyright (C) 2003-2017 Free Software Foundation, Inc.
a31 2
#pragma GCC system_header
d313 1
a313 1
auto __res = _Base::insert(__obj);
d315 1
a315 1
return { iterator(__res.first, this), __res.second };
d318 2
a319 4
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
std::pair
insert(value_type&& __x)
d321 1
d323 1
a323 1
auto __res = _Base::insert(std::move(__x));
d325 1
a325 1
return { iterator(__res.first, this), __res.second };
a340 22
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
_Base_iterator __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
d459 1
a459 4
#endif // C++17
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
a460 48
struct insert_return_type
{
bool inserted;
iterator position;
node_type node;
};
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
_Base_const_iterator __victim = __position.base();
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; }
);
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it) {
return __it._M_curr() == __victim._M_cur;
});
return _Base::extract(__position.base());
}
node_type
extract(const key_type& __key)
{
const auto __position = find(__key);
if (__position != end())
return extract(__position);
return {};
}
insert_return_type
insert(node_type&& __nh)
{
auto __ret = _Base::insert(std::move(__nh));
iterator __pos = iterator(__ret.position, this);
return { __ret.inserted, __pos, std::move(__ret.node) };
}
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
}
using _Base::merge;
#endif // C++17
a856 11
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(value_type&& __x)
{
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(std::move(__x));
_M_check_rehashed(__bucket_count);
return { __it, this };
}
a866 12
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
return iterator(__it, this);
}
a913 41
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
_Base_const_iterator __victim = __position.base();
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; }
);
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it) {
return __it._M_curr() == __victim._M_cur;
});
return _Base::extract(__position.base());
}
node_type
extract(const key_type& __key)
{
const auto __position = find(__key);
if (__position != end())
return extract(__position);
return {};
}
iterator
insert(node_type&& __nh)
{ return iterator(_Base::insert(std::move(__nh)), this); }
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
}
using _Base::merge;
#endif // C++17
@
1.1.1.6
log
@import GCC 8.3. it includes these new features:
- many optimisations improved: inter-procedural, profile-directed,
LTO, loops including user-controllable unroll support, and more.
- columns numbers added to line numbers in dwarf
- gcov extended significantly
- many sanitizer updates
- many new warning messages
- many better hints and more useful error messages
- minor ABI changes on x86-64 libstdc++, and some c++17 modes
- draft c++2a features
- better c++17 experimental support
- Armv8.4-A supported, better 8.2-A and 8.3-A support, including
32 bit arm port. cortex a-55, a-75 and a-55.a-75 combo support.
- in the GCC bugzilla, 8.1 shows 1149 bugs fixed, 8.2 shows 100, and
8.3 shows 158.
@
text
@d3 1
a3 1
// Copyright (C) 2003-2018 Free Software Foundation, Inc.
d488 7
a494 1
using insert_return_type = _Node_insert_return;
d525 1
a525 1
return { __pos, __ret.inserted, std::move(__ret.node) };
a641 76
#if __cpp_deduction_guides >= 201606
template>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
_Hash, _Pred, _Allocator>;
template,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list>,
typename unordered_map::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type,
_Hash, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template>
unordered_map(initializer_list>,
typename unordered_map::size_type,
_Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_map(initializer_list>, _Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_map(initializer_list>,
typename unordered_map::size_type,
_Hash, _Allocator)
-> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
a1158 76
#if __cpp_deduction_guides >= 201606
template>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash, _Pred,
_Allocator>;
template,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list>,
unordered_multimap::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type, _Hash,
_Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template>
unordered_multimap(initializer_list>,
unordered_multimap::size_type,
_Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_multimap(initializer_list>, _Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_multimap(initializer_list>,
unordered_multimap::size_type,
_Hash, _Allocator)
-> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
@
1.1.1.7
log
@import GCC 7.5.0. doing this here so that the vendor branch has
the code we'll merge into gcc.old and the netbsd-9 tree gcc tree.
GCC 8.4.0 will be imported immediately on top of this again,
restoring the current status.
these PRs in the GCC bugzilla are fixed with this update:
89869 80693 89795 84272 85593 86669 87148 87647 87895 88103 88107 88563
88870 88976 89002 89187 89195 89234 89303 89314 89354 89361 89403 89412
89512 89520 89590 89621 89663 89679 89704 89734 89872 89933 90090 90208
87075 85870 89009 89242 88167 80864 81933 85890 86608 87145 88857 89024
89119 89214 89511 89612 89705 89400 81740 82186 84552 86554 87609 88105
88149 88415 88739 88903 89135 89223 89296 89505 89572 89677 89698 89710
90006 90020 90071 90328 90474 91126 91162 91812 91887 90075 88998 89945
87047 87506 88074 88656 88740 91137 89008 84010 89349 91136 91347 91995
89397 87030 60702 78884 85594 87649 87725 88181 88470 88553 88568 88588
88620 88644 88906 88949 89246 89587 89726 89768 89796 89998 90108 90756
90950 91704 88825 88983 86538 51333 89446 90220 91308 92143 89392 90213
90278 91131 91200 91510 89037 91481 87673 88418 88938 88948 90547 27221
58321 61250 67183 67958 77583 83531 86215 88648 88720 88726 89091 89466
89629 90105 90329 90585 90760 90924 91087 89222 81956 71861 35031 69455
81849 82993 85798 88138 88155 88169 88205 88206 88228 88249 88269 88376
77703 80260 82077 86248 88393 90786 57048 66089 66695 67679 68009 71723
72714 84394 85544 87734 88298 90937 91557 63891 64132 65342 68649 68717
71066 71860 71935 77746 78421 78645 78865 78983 79485 79540 85953 88326
89651 90744
@
text
@d3 1
a3 1
// Copyright (C) 2003-2017 Free Software Foundation, Inc.
d488 1
a488 7
struct insert_return_type
{
bool inserted;
iterator position;
node_type node;
};
d519 1
a519 1
return { __ret.inserted, __pos, std::move(__ret.node) };
d636 76
d1229 76
@
1.1.1.8
log
@re-import GCC 8.4.0.
@
text
@d3 1
a3 1
// Copyright (C) 2003-2018 Free Software Foundation, Inc.
d488 7
a494 1
using insert_return_type = _Node_insert_return;
d525 1
a525 1
return { __pos, __ret.inserted, std::move(__ret.node) };
a641 76
#if __cpp_deduction_guides >= 201606
template>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
_Hash, _Pred, _Allocator>;
template,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list>,
typename unordered_map::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map::size_type,
_Hash, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template>
unordered_map(initializer_list>,
typename unordered_map::size_type,
_Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_map(initializer_list>, _Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_map(initializer_list>,
typename unordered_map::size_type,
_Hash, _Allocator)
-> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
a1158 76
#if __cpp_deduction_guides >= 201606
template>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash, _Pred,
_Allocator>;
template,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list>,
unordered_multimap::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap::size_type, _Hash,
_Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template>
unordered_multimap(initializer_list>,
unordered_multimap::size_type,
_Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_multimap(initializer_list>, _Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template>
unordered_multimap(initializer_list>,
unordered_multimap::size_type,
_Hash, _Allocator)
-> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
@
1.1.1.9
log
@initial import of GCC 9.3.0. changes include:
- live patching support
- shell completion help
- generally better diagnostic output (less verbose/more useful)
- diagnostics and optimisation choices can be emitted in json
- asan memory usage reduction
- many general, and specific to switch, inter-procedure,
profile and link-time optimisations. from the release notes:
"Overall compile time of Firefox 66 and LibreOffice 6.2.3 on
an 8-core machine was reduced by about 5% compared to GCC 8.3"
- OpenMP 5.0 support
- better spell-guesser
- partial experimental support for c2x and c++2a
- c++17 is no longer experimental
- arm AAPCS GCC 6-8 structure passing bug fixed, may cause
incompatibility (restored compat with GCC 5 and earlier.)
- openrisc support
@
text
@d3 1
a3 1
// Copyright (C) 2003-2019 Free Software Foundation, Inc.
a36 10
# include
namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
template
class unordered_map;
template
class unordered_multimap;
} } // namespace std::__debug
a68 5
template
friend class ::__gnu_debug::_Safe_iterator;
template
friend class ::__gnu_debug::_Safe_local_iterator;
d102 2
a103 2
: _Base(__gnu_debug::__base(
__glibcxx_check_valid_constructor_range(__first, __last)),
d205 1
a205 1
{ return { _Base::begin(), this }; }
d209 1
a209 1
{ return { _Base::begin(), this }; }
d213 1
a213 1
{ return { _Base::end(), this }; }
d217 1
a217 1
{ return { _Base::end(), this }; }
d221 1
a221 1
{ return { _Base::cbegin(), this }; }
d225 1
a225 1
{ return { _Base::cend(), this }; }
d232 1
a232 1
return { _Base::begin(__b), this };
d239 1
a239 1
return { _Base::end(__b), this };
d246 1
a246 1
return { _Base::begin(__b), this };
d253 1
a253 1
return { _Base::end(__b), this };
d260 1
a260 1
return { _Base::cbegin(__b), this };
d267 1
a267 1
return { _Base::cend(__b), this };
d293 2
a294 1
auto __res = _Base::emplace(std::forward<_Args>(__args)...);
d296 1
a296 1
return { { __res.first, this }, __res.second };
d305 2
a306 2
auto __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
d308 1
a308 1
return { __it, this };
d317 1
a317 1
return { { __res.first, this }, __res.second };
d328 1
a328 1
return { { __res.first, this }, __res.second };
d338 2
a339 1
auto __res = _Base::insert(std::forward<_Pair>(__obj));
d341 1
a341 1
return { { __res.first, this }, __res.second };
d349 1
a349 1
auto __it = _Base::insert(__hint.base(), __obj);
d351 1
a351 1
return { __it, this };
d363 1
a363 1
return { __it, this };
d374 2
a375 1
auto __it = _Base::insert(__hint.base(), std::forward<_Pair>(__obj));
d377 1
a377 1
return { __it, this };
d407 3
a409 3
pair
try_emplace(const key_type& __k, _Args&&... __args)
{
d412 1
a412 1
return { { __res.first, this }, __res.second };
d416 3
a418 3
pair
try_emplace(key_type&& __k, _Args&&... __args)
{
d421 1
a421 1
return { { __res.first, this }, __res.second };
d425 4
a428 4
iterator
try_emplace(const_iterator __hint, const key_type& __k,
_Args&&... __args)
{
d430 3
a432 3
return { _Base::try_emplace(__hint.base(), __k,
std::forward<_Args>(__args)...),
this };
d436 3
a438 3
iterator
try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
{
d440 3
a442 3
return { _Base::try_emplace(__hint.base(), std::move(__k),
std::forward<_Args>(__args)...),
this };
d446 3
a448 3
pair
insert_or_assign(const key_type& __k, _Obj&& __obj)
{
d451 1
a451 1
return { { __res.first, this }, __res.second };
d455 3
a457 3
pair
insert_or_assign(key_type&& __k, _Obj&& __obj)
{
d460 1
a460 1
return { { __res.first, this }, __res.second };
d464 4
a467 4
iterator
insert_or_assign(const_iterator __hint, const key_type& __k,
_Obj&& __obj)
{
d469 3
a471 3
return { _Base::insert_or_assign(__hint.base(), __k,
std::forward<_Obj>(__obj)),
this };
d475 3
a477 3
iterator
insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
{
d479 4
a482 3
return { _Base::insert_or_assign(__hint.base(), std::move(__k),
std::forward<_Obj>(__obj)),
this };
d494 9
a502 1
return _M_extract(__position.base());
d508 3
a510 3
const auto __position = _Base::find(__key);
if (__position != _Base::end())
return _M_extract(__position);
d518 2
a519 2
return
{ { __ret.position, this }, __ret.inserted, std::move(__ret.node) };
d526 1
a526 1
return { _Base::insert(__hint.base(), std::move(__nh)), this };
d534 1
a534 1
{ return { _Base::find(__key), this }; }
d538 1
a538 1
{ return { _Base::find(__key), this }; }
d543 4
a546 2
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
d552 4
a555 2
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
d562 1
a562 1
auto __victim = _Base::find(__key);
d565 8
a572 1
_M_erase(__victim);
d582 10
a591 1
return { _M_erase(__it.base()), this };
d596 1
a596 4
{
__glibcxx_check_erase(__it);
return { _M_erase(__it.base()), this };
}
d602 2
a603 1
for (auto __tmp = __first.base(); __tmp != __last.base(); ++__tmp)
d605 1
a605 1
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::cend(),
d609 5
a613 1
_M_invalidate(__tmp);
a614 1
d616 1
a616 1
auto __next = _Base::erase(__first.base(), __last.base());
d618 1
a618 1
return { __next, this };
d632 1
a632 1
this->_M_invalidate_all();
a633 29
void
_M_invalidate(_Base_const_iterator __victim)
{
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_curr() == __victim._M_cur; });
}
_Base_iterator
_M_erase(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__victim);
_M_check_rehashed(__bucket_count);
return __next;
}
#if __cplusplus > 201402L
node_type
_M_extract(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
return _Base::extract(__victim);
}
#endif
a642 2
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
a653 2
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
a682 1
typename = _RequireNotAllocatorOrIntegral<_Hash>,
a703 1
typename = _RequireNotAllocatorOrIntegral<_Hash>,
d744 1
a744 2
public _GLIBCXX_STD_C::unordered_multimap<
_Key, _Tp, _Hash, _Pred, _Alloc>
a754 5
template
friend class ::__gnu_debug::_Safe_iterator;
template
friend class ::__gnu_debug::_Safe_local_iterator;
d771 1
a771 1
_Base_const_local_iterator, unordered_multimap> const_local_iterator;
d788 2
a789 2
: _Base(__gnu_debug::__base(
__glibcxx_check_valid_constructor_range(__first, __last)),
d888 1
a888 1
{ return { _Base::begin(), this }; }
d892 1
a892 1
{ return { _Base::begin(), this }; }
d896 1
a896 1
{ return { _Base::end(), this }; }
d900 1
a900 1
{ return { _Base::end(), this }; }
d904 1
a904 1
{ return { _Base::cbegin(), this }; }
d908 1
a908 1
{ return { _Base::cend(), this }; }
d915 1
a915 1
return { _Base::begin(__b), this };
d922 1
a922 1
return { _Base::end(__b), this };
d929 1
a929 1
return { _Base::begin(__b), this };
d936 1
a936 1
return { _Base::end(__b), this };
d943 1
a943 1
return { _Base::cbegin(__b), this };
d950 1
a950 1
return { _Base::cend(__b), this };
d976 2
a977 1
auto __it = _Base::emplace(std::forward<_Args>(__args)...);
d979 1
a979 1
return { __it, this };
d988 2
a989 2
auto __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
d991 1
a991 1
return { __it, this };
d998 1
a998 1
auto __it = _Base::insert(__obj);
d1000 1
a1000 1
return { __it, this };
d1019 1
a1019 1
auto __it = _Base::insert(__hint.base(), __obj);
d1021 1
a1021 1
return { __it, this };
d1033 1
a1033 1
return { __it, this };
d1043 1
a1043 1
auto __it = _Base::insert(std::forward<_Pair>(__obj));
d1045 1
a1045 1
return { __it, this };
d1056 2
a1057 1
auto __it = _Base::insert(__hint.base(), std::forward<_Pair>(__obj));
d1059 1
a1059 1
return { __it, this };
d1090 9
a1098 1
return _M_extract(__position.base());
d1104 3
a1106 3
const auto __position = _Base::find(__key);
if (__position != _Base::end())
return _M_extract(__position);
d1112 1
a1112 1
{ return { _Base::insert(std::move(__nh)), this }; }
d1118 1
a1118 1
return { _Base::insert(__hint.base(), std::move(__nh)), this };
d1126 1
a1126 1
{ return { _Base::find(__key), this }; }
d1130 1
a1130 1
{ return { _Base::find(__key), this }; }
d1135 4
a1138 2
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
d1144 4
a1147 2
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
d1155 3
a1157 2
auto __pair = _Base::equal_range(__key);
for (auto __victim = __pair.first; __victim != __pair.second;)
d1159 6
a1164 2
_M_invalidate(__victim);
__victim = _Base::erase(__victim);
a1166 1
d1175 10
a1184 1
return { _M_erase(__it.base()), this };
d1189 1
a1189 4
{
__glibcxx_check_erase(__it);
return { _M_erase(__it.base()), this };
}
d1195 2
a1196 1
for (auto __tmp = __first.base(); __tmp != __last.base(); ++__tmp)
d1198 1
a1198 1
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::cend(),
d1202 5
a1206 1
_M_invalidate(__tmp);
a1207 1
d1209 1
a1209 1
auto __next = _Base::erase(__first.base(), __last.base());
d1211 1
a1211 1
return { __next, this };
d1225 1
a1225 21
this->_M_invalidate_all();
}
void
_M_invalidate(_Base_const_iterator __victim)
{
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it._M_curr() == __victim._M_cur; });
}
_Base_iterator
_M_erase(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__victim);
_M_check_rehashed(__bucket_count);
return __next;
a1226 9
#if __cplusplus > 201402L
node_type
_M_extract(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
return _Base::extract(__victim);
}
#endif
a1235 2
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
a1247 2
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
a1275 1
typename = _RequireNotAllocatorOrIntegral<_Hash>,
a1296 1
typename = _RequireNotAllocatorOrIntegral<_Hash>,
@
1.1.1.10
log
@initial import of GCC 10.3.0. main changes include:
caveats:
- ABI issue between c++14 and c++17 fixed
- profile mode is removed from libstdc++
- -fno-common is now the default
new features:
- new flags -fallocation-dce, -fprofile-partial-training,
-fprofile-reproducible, -fprofile-prefix-path, and -fanalyzer
- many new compile and link time optimisations
- enhanced drive optimisations
- openacc 2.6 support
- openmp 5.0 features
- new warnings: -Wstring-compare and -Wzero-length-bounds
- extended warnings: -Warray-bounds, -Wformat-overflow,
-Wrestrict, -Wreturn-local-addr, -Wstringop-overflow,
-Warith-conversion, -Wmismatched-tags, and -Wredundant-tags
- some likely C2X features implemented
- more C++20 implemented
- many new arm & intel CPUs known
hundreds of reported bugs are fixed. full list of changes
can be found at:
https://gcc.gnu.org/gcc-10/changes.html
@
text
@d3 1
a3 1
// Copyright (C) 2003-2020 Free Software Foundation, Inc.
a743 1
#if __cpp_impl_three_way_comparison < 201907L
d750 1
a750 1
#endif
a1349 1
#if __cpp_impl_three_way_comparison < 201907L
a1355 1
#endif
@
1.1.1.11
log
@initial import of GCC 10.4.0 sources.
mostly a large list of PRs fixed (210 total), plus one x86-64
specific change related to MMX and 64 bit integer return.
https://gcc.gnu.org/gcc-10/changes.html links to the full list
of PRs fixed.
@
text
@a138 1
noexcept( noexcept(_Base(std::move(__umap._M_base()), __a)) )
d163 1
a163 1
: unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
d171 1
a171 1
: unordered_map(__first, __last, __n, __hf, key_equal(), __a)
d177 1
a177 1
: unordered_map(__l, __n, hasher(), key_equal(), __a)
d184 1
a184 1
: unordered_map(__l, __n, __hf, key_equal(), __a)
a833 1
noexcept( noexcept(_Base(std::move(__umap._M_base()), __a)) )
d857 1
a857 1
: unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
d864 1
a864 1
: unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
d870 1
a870 1
: unordered_multimap(__l, __n, hasher(), key_equal(), __a)
d876 1
a876 1
: unordered_multimap(__l, __n, __hf, key_equal(), __a)
@
1.1.1.12
log
@initial import of GCC 12.3.0.
major changes in GCC 11 included:
- The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14.
- When building GCC itself, the host compiler must now support C++11,
rather than C++98.
- Some short options of the gcov tool have been renamed: -i to -j and
-j to -H.
- ThreadSanitizer improvements.
- Introduce Hardware-assisted AddressSanitizer support.
- For targets that produce DWARF debugging information GCC now defaults
to DWARF version 5. This can produce up to 25% more compact debug
information compared to earlier versions.
- Many optimisations.
- The existing malloc attribute has been extended so that it can be
used to identify allocator/deallocator API pairs. A pair of new
-Wmismatched-dealloc and -Wmismatched-new-delete warnings are added.
- Other new warnings:
-Wsizeof-array-div, enabled by -Wall, warns about divisions of two
sizeof operators when the first one is applied to an array and the
divisor does not equal the size of the array element.
-Wstringop-overread, enabled by default, warns about calls to string
functions reading past the end of the arrays passed to them as
arguments.
-Wtsan, enabled by default, warns about unsupported features in
ThreadSanitizer (currently std::atomic_thread_fence).
- Enchanced warnings:
-Wfree-nonheap-object detects many more instances of calls to
deallocation functions with pointers not returned from a dynamic
memory allocation function.
-Wmaybe-uninitialized diagnoses passing pointers or references to
uninitialized memory to functions taking const-qualified arguments.
-Wuninitialized detects reads from uninitialized dynamically
allocated memory.
-Warray-parameter warns about functions with inconsistent array forms.
-Wvla-parameter warns about functions with inconsistent VLA forms.
- Several new features from the upcoming C2X revision of the ISO C
standard are supported with -std=c2x and -std=gnu2x.
- Several C++20 features have been implemented.
- The C++ front end has experimental support for some of the upcoming
C++23 draft.
- Several new C++ warnings.
- Enhanced Arm, AArch64, x86, and RISC-V CPU support.
- The implementation of how program state is tracked within
-fanalyzer has been completely rewritten with many enhancements.
see https://gcc.gnu.org/gcc-11/changes.html for a full list.
major changes in GCC 12 include:
- An ABI incompatibility between C and C++ when passing or returning
by value certain aggregates containing zero width bit-fields has
been discovered on various targets. x86-64, ARM and AArch64
will always ignore them (so there is a C ABI incompatibility
between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2
always take them into account (so there is a C++ ABI
incompatibility, GCC 4.4 and earlier compatible with GCC 12 or
later, incompatible with GCC 4.5 through GCC 11). RISC-V has
changed the handling of these already starting with GCC 10. As
the ABI requires, MIPS takes them into account handling function
return values so there is a C++ ABI incompatibility with GCC 4.5
through 11.
- STABS: Support for emitting the STABS debugging format is
deprecated and will be removed in the next release. All ports now
default to emit DWARF (version 2 or later) debugging info or are
obsoleted.
- Vectorization is enabled at -O2 which is now equivalent to the
original -O2 -ftree-vectorize -fvect-cost-model=very-cheap.
- GCC now supports the ShadowCallStack sanitizer.
- Support for __builtin_shufflevector compatible with the clang
language extension was added.
- Support for attribute unavailable was added.
- Support for __builtin_dynamic_object_size compatible with the
clang language extension was added.
- New warnings:
-Wbidi-chars warns about potentially misleading UTF-8
bidirectional control characters.
-Warray-compare warns about comparisons between two operands of
array type.
- Some new features from the upcoming C2X revision of the ISO C
standard are supported with -std=c2x and -std=gnu2x.
- Several C++23 features have been implemented.
- Many C++ enhancements across warnings and -f options.
see https://gcc.gnu.org/gcc-12/changes.html for a full list.
@
text
@d3 1
a3 1
// Copyright (C) 2003-2022 Free Software Foundation, Inc.
a83 8
// Reference wrapper for base class. See PR libstdc++/90102.
struct _Base_ref
{
_Base_ref(const _Base& __r) : _M_ref(__r) { }
const _Base& _M_ref;
};
a91 1
typedef typename _Base::mapped_type mapped_type;
a92 4
typedef typename _Base::pointer pointer;
typedef typename _Base::const_pointer const_pointer;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
a100 1
typedef typename _Base::difference_type difference_type;
d124 2
a125 2
unordered_map(_Base_ref __x)
: _Base(__x._M_ref) { }
d139 3
a141 3
noexcept( noexcept(_Base(std::move(__umap), __a)) )
: _Safe(std::move(__umap), __a),
_Base(std::move(__umap), __a) { }
d199 1
a199 1
_Base::operator=(__l);
a203 5
using _Base::get_allocator;
using _Base::empty;
using _Base::size;
using _Base::max_size;
a285 4
using _Base::bucket_count;
using _Base::max_bucket_count;
using _Base::bucket;
a292 2
using _Base::load_factor;
d533 1
a533 27
template
void
merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_uc_guard(std::__detail::_Select1st{}, __source);
_Base::merge(__source);
}
template
void
merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
{ merge(__source); }
template
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_umc_guard(std::__detail::_Select1st{}, __source);
_Base::merge(__source);
}
template
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
{ merge(__source); }
a535 3
using _Base::hash_function;
using _Base::key_eq;
a539 9
#if __cplusplus > 201703L
template,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
iterator
find(const _Kt& __k)
{ return { _Base::find(__k), this }; }
#endif
a543 14
#if __cplusplus > 201703L
template,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
const_iterator
find(const _Kt& __k) const
{ return { _Base::find(__k), this }; }
#endif
using _Base::count;
#if __cplusplus > 201703L
using _Base::contains;
#endif
a550 12
#if __cplusplus > 201703L
template,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
std::pair
equal_range(const _Kt& __k)
{
auto __res = _Base::equal_range(__k);
return { { __res.first, this }, { __res.second, this } };
}
#endif
a557 15
#if __cplusplus > 201703L
template,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
std::pair
equal_range(const _Kt& __k) const
{
auto __res = _Base::equal_range(__k);
return { { __res.first, this }, { __res.second, this } };
}
#endif
using _Base::operator[];
using _Base::at;
a577 7
_Base_iterator
erase(_Base_const_iterator __it)
{
__glibcxx_check_erase2(__it);
return _M_erase(__it);
}
a603 3
using _Base::rehash;
using _Base::reserve;
d625 1
a625 1
{ return __it == __victim; });
a779 8
// Reference wrapper for base class. See PR libstdc++/90102.
struct _Base_ref
{
_Base_ref(const _Base& __r) : _M_ref(__r) { }
const _Base& _M_ref;
};
a787 1
typedef typename _Base::mapped_type mapped_type;
a788 4
typedef typename _Base::pointer pointer;
typedef typename _Base::const_pointer const_pointer;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
a796 1
typedef typename _Base::difference_type difference_type;
d820 2
a821 2
unordered_multimap(_Base_ref __x)
: _Base(__x._M_ref) { }
d835 3
a837 3
noexcept( noexcept(_Base(std::move(__umap), __a)) )
: _Safe(std::move(__umap), __a),
_Base(std::move(__umap), __a) { }
d892 1
a892 1
_Base::operator=(__l);
a896 5
using _Base::get_allocator;
using _Base::empty;
using _Base::size;
using _Base::max_size;
a978 4
using _Base::bucket_count;
using _Base::max_bucket_count;
using _Base::bucket;
d1137 1
a1137 27
template
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_umc_guard(std::__detail::_Select1st{}, __source);
_Base::merge(__source);
}
template