+2018-10-03 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/debug/map.h
+ (map<>::emplace<>(_Args&&...)): Use C++11 direct initialization.
+ (map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise.
+ (map<>::insert(value_type&&)): Likewise.
+ (map<>::insert<>(_Pair&&)): Likewise.
+ (map<>::insert<>(const_iterator, _Pair&&)): Likewise.
+ (map<>::try_emplace): Likewise.
+ (map<>::insert_or_assign): Likewise.
+ (map<>::insert(node_type&&)): Likewise.
+ (map<>::insert(const_iterator, node_type&&)): Likewise.
+ (map<>::erase(const_iterator)): Likewise.
+ (map<>::erase(const_iterator, const_iterator)): Likewise.
+ * include/debug/multimap.h
+ (multimap<>::emplace<>(_Args&&...)): Use C++11 direct initialization.
+ (multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise.
+ (multimap<>::insert<>(_Pair&&)): Likewise.
+ (multimap<>::insert<>(const_iterator, _Pair&&)): Likewise.
+ (multimap<>::insert(node_type&&)): Likewise.
+ (multimap<>::insert(const_iterator, node_type&&)): Likewise.
+ (multimap<>::erase(const_iterator)): Likewise.
+ (multimap<>::erase(const_iterator, const_iterator)): Likewise.
+ * include/debug/set.h
+ (set<>::emplace<>(_Args&&...)): Use C++11 direct initialization.
+ (set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise.
+ (set<>::insert(value_type&&)): Likewise.
+ (set<>::insert<>(const_iterator, value_type&&)): Likewise.
+ (set<>::insert(const_iterator, node_type&&)): Likewise.
+ (set<>::erase(const_iterator)): Likewise.
+ (set<>::erase(const_iterator, const_iterator)): Likewise.
+ * include/debug/multiset.h
+ (multiset<>::emplace<>(_Args&&...)): Use C++11 direct initialization.
+ (multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise.
+ (multiset<>::insert<>(value_type&&)): Likewise.
+ (multiset<>::insert<>(const_iterator, value_type&&)): Likewise.
+ (multiset<>::insert(node_type&&)): Likewise.
+ (multiset<>::insert(const_iterator, node_type&&)): Likewise.
+ (multiset<>::erase(const_iterator)): Likewise.
+ (multiset<>::erase(const_iterator, const_iterator)): Likewise.
+
2018-10-02 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/87258
emplace(_Args&&... __args)
{
auto __res = _Base::emplace(std::forward<_Args>(__args)...);
- return std::pair<iterator, bool>(iterator(__res.first, this),
- __res.second);
+ return { { __res.first, this }, __res.second };
}
template<typename... _Args>
emplace_hint(const_iterator __pos, _Args&&... __args)
{
__glibcxx_check_insert(__pos);
- return iterator(_Base::emplace_hint(__pos.base(),
- std::forward<_Args>(__args)...),
- this);
+ return
+ {
+ _Base::emplace_hint(__pos.base(), std::forward<_Args>(__args)...),
+ this
+ };
}
#endif
insert(value_type&& __x)
{
auto __res = _Base::insert(std::move(__x));
- return { iterator(__res.first, this), __res.second };
+ return { { __res.first, this }, __res.second };
}
template<typename _Pair, typename = typename
std::pair<iterator, bool>
insert(_Pair&& __x)
{
- std::pair<_Base_iterator, bool> __res
- = _Base::insert(std::forward<_Pair>(__x));
- return std::pair<iterator, bool>(iterator(__res.first, this),
- __res.second);
+ auto __res = _Base::insert(std::forward<_Pair>(__x));
+ return { { __res.first, this }, __res.second };
}
#endif
insert(const_iterator __position, _Pair&& __x)
{
__glibcxx_check_insert(__position);
- return iterator(_Base::insert(__position.base(),
- std::forward<_Pair>(__x)), this);
+ return
+ {
+ _Base::insert(__position.base(), std::forward<_Pair>(__x)),
+ this
+ };
}
#endif
{
auto __res = _Base::try_emplace(__k,
std::forward<_Args>(__args)...);
- return { iterator(__res.first, this), __res.second };
+ return { { __res.first, this }, __res.second };
}
template <typename... _Args>
{
auto __res = _Base::try_emplace(std::move(__k),
std::forward<_Args>(__args)...);
- return { iterator(__res.first, this), __res.second };
+ return { { __res.first, this }, __res.second };
}
template <typename... _Args>
_Args&&... __args)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::try_emplace(__hint.base(), __k,
- std::forward<_Args>(__args)...),
- this);
+ return
+ {
+ _Base::try_emplace(__hint.base(), __k,
+ std::forward<_Args>(__args)...),
+ this
+ };
}
template <typename... _Args>
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);
+ return
+ {
+ _Base::try_emplace(__hint.base(), std::move(__k),
+ std::forward<_Args>(__args)...),
+ this
+ };
}
template <typename _Obj>
{
auto __res = _Base::insert_or_assign(__k,
std::forward<_Obj>(__obj));
- return { iterator(__res.first, this), __res.second };
+ return { { __res.first, this }, __res.second };
}
template <typename _Obj>
{
auto __res = _Base::insert_or_assign(std::move(__k),
std::forward<_Obj>(__obj));
- return { iterator(__res.first, this), __res.second };
+ return { { __res.first, this }, __res.second };
}
template <typename _Obj>
const key_type& __k, _Obj&& __obj)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert_or_assign(__hint.base(), __k,
- std::forward<_Obj>(__obj)),
- this);
+ return
+ {
+ _Base::insert_or_assign(__hint.base(), __k,
+ std::forward<_Obj>(__obj)),
+ this
+ };
}
template <typename _Obj>
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);
+ return
+ {
+ _Base::insert_or_assign(__hint.base(), std::move(__k),
+ std::forward<_Obj>(__obj)),
+ this
+ };
}
#endif // C++17
insert(node_type&& __nh)
{
auto __ret = _Base::insert(std::move(__nh));
- iterator __pos = iterator(__ret.position, this);
- return { __pos, __ret.inserted, std::move(__ret.node) };
+ return
+ { { __ret.position, this }, __ret.inserted, 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);
+ return { _Base::insert(__hint.base(), std::move(__nh)), this };
}
using _Base::merge;
{
__glibcxx_check_erase(__position);
this->_M_invalidate_if(_Equal(__position.base()));
- return iterator(_Base::erase(__position.base()), this);
+ return { _Base::erase(__position.base()), this };
}
iterator
._M_iterator(__last, "last"));
this->_M_invalidate_if(_Equal(__victim));
}
- return iterator(_Base::erase(__first.base(), __last.base()), this);
+
+ return { _Base::erase(__first.base(), __last.base()), this };
}
#else
void
template<typename... _Args>
iterator
emplace(_Args&&... __args)
- {
- return iterator(_Base::emplace(std::forward<_Args>(__args)...), this);
- }
+ { return { _Base::emplace(std::forward<_Args>(__args)...), this }; }
template<typename... _Args>
iterator
emplace_hint(const_iterator __pos, _Args&&... __args)
{
__glibcxx_check_insert(__pos);
- return iterator(_Base::emplace_hint(__pos.base(),
- std::forward<_Args>(__args)...),
- this);
+ return
+ {
+ _Base::emplace_hint(__pos.base(), std::forward<_Args>(__args)...),
+ this
+ };
}
#endif
_Pair&&>::value>::type>
iterator
insert(_Pair&& __x)
- { return iterator(_Base::insert(std::forward<_Pair>(__x)), this); }
+ { return { _Base::insert(std::forward<_Pair>(__x)), this }; }
#endif
#if __cplusplus >= 201103L
insert(const_iterator __position, _Pair&& __x)
{
__glibcxx_check_insert(__position);
- return iterator(_Base::insert(__position.base(),
- std::forward<_Pair>(__x)), this);
+ return
+ {
+ _Base::insert(__position.base(), std::forward<_Pair>(__x)),
+ this
+ };
}
#endif
iterator
insert(node_type&& __nh)
- { return iterator(_Base::insert(std::move(__nh)), this); }
+ { return { _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);
+ return { _Base::insert(__hint.base(), std::move(__nh)), this };
}
using _Base::merge;
{
__glibcxx_check_erase(__position);
this->_M_invalidate_if(_Equal(__position.base()));
- return iterator(_Base::erase(__position.base()), this);
+ return { _Base::erase(__position.base()), this };
}
iterator
._M_iterator(__last, "last"));
this->_M_invalidate_if(_Equal(__victim));
}
- return iterator(_Base::erase(__first.base(), __last.base()), this);
+
+ return { _Base::erase(__first.base(), __last.base()), this };
}
#else
void
template<typename... _Args>
iterator
emplace(_Args&&... __args)
- {
- return iterator(_Base::emplace(std::forward<_Args>(__args)...),
- this);
- }
+ { return { _Base::emplace(std::forward<_Args>(__args)...), this }; }
template<typename... _Args>
iterator
emplace_hint(const_iterator __pos, _Args&&... __args)
{
__glibcxx_check_insert(__pos);
- return iterator(_Base::emplace_hint(__pos.base(),
- std::forward<_Args>(__args)...),
- this);
+ return
+ {
+ _Base::emplace_hint(__pos.base(), std::forward<_Args>(__args)...),
+ this
+ };
}
#endif
#if __cplusplus >= 201103L
iterator
insert(value_type&& __x)
- { return iterator(_Base::insert(std::move(__x)), this); }
+ { return { _Base::insert(std::move(__x)), this }; }
#endif
iterator
insert(const_iterator __position, value_type&& __x)
{
__glibcxx_check_insert(__position);
- return iterator(_Base::insert(__position.base(), std::move(__x)),
- this);
+ return { _Base::insert(__position.base(), std::move(__x)), this };
}
#endif
iterator
insert(node_type&& __nh)
- { return iterator(_Base::insert(std::move(__nh)), this); }
+ { return { _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);
+ return { _Base::insert(__hint.base(), std::move(__nh)), this };
}
using _Base::merge;
{
__glibcxx_check_erase(__position);
this->_M_invalidate_if(_Equal(__position.base()));
- return iterator(_Base::erase(__position.base()), this);
+ return { _Base::erase(__position.base()), this };
}
#else
void
._M_iterator(__last, "last"));
this->_M_invalidate_if(_Equal(__victim));
}
- return iterator(_Base::erase(__first.base(), __last.base()), this);
+
+ return { _Base::erase(__first.base(), __last.base()), this };
}
#else
void
emplace(_Args&&... __args)
{
auto __res = _Base::emplace(std::forward<_Args>(__args)...);
- return std::pair<iterator, bool>(iterator(__res.first, this),
- __res.second);
+ return { { __res.first, this }, __res.second };
}
template<typename... _Args>
emplace_hint(const_iterator __pos, _Args&&... __args)
{
__glibcxx_check_insert(__pos);
- return iterator(_Base::emplace_hint(__pos.base(),
- std::forward<_Args>(__args)...),
- this);
+ return
+ {
+ _Base::emplace_hint(__pos.base(), std::forward<_Args>(__args)...),
+ this
+ };
}
#endif
std::pair<iterator, bool>
insert(value_type&& __x)
{
- std::pair<_Base_iterator, bool> __res
- = _Base::insert(std::move(__x));
- return std::pair<iterator, bool>(iterator(__res.first, this),
- __res.second);
+ auto __res = _Base::insert(std::move(__x));
+ return { { __res.first, this }, __res.second };
}
#endif
insert(const_iterator __position, value_type&& __x)
{
__glibcxx_check_insert(__position);
- return iterator(_Base::insert(__position.base(), std::move(__x)),
- this);
+ return { _Base::insert(__position.base(), std::move(__x)), this };
}
#endif
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
- return iterator(_Base::insert(__hint.base(), std::move(__nh)), this);
+ return { _Base::insert(__hint.base(), std::move(__nh)), this };
}
using _Base::merge;
{
__glibcxx_check_erase(__position);
this->_M_invalidate_if(_Equal(__position.base()));
- return iterator(_Base::erase(__position.base()), this);
+ return { _Base::erase(__position.base()), this };
}
#else
void
._M_iterator(__last, "last"));
this->_M_invalidate_if(_Equal(__victim));
}
- return iterator(_Base::erase(__first.base(), __last.base()), this);
+
+ return { _Base::erase(__first.base(), __last.base()), this };
}
#else
void