Commit bb5033e4 authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Chromium LUCI CQ

[base] Inline default assignment operators in flat_tree

This change inlines the defaulted assignment operators in flat_tree.
Furthermore, this works around a compiler bug exposed in old GCC
versions.

Fixed: 1154608
Change-Id: I488b6003de6630d2d18b7849bc903db2d41ed9bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566943
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833080}
parent 40c5dddc
......@@ -228,9 +228,9 @@ class flat_tree {
//
// Assume that move assignment invalidates iterators and references.
flat_tree& operator=(const flat_tree&);
flat_tree& operator=(const flat_tree&) = default;
flat_tree& operator=(flat_tree&&) noexcept(
std::is_nothrow_move_assignable<container_type>::value);
std::is_nothrow_move_assignable<container_type>::value) = default;
// Takes the first if there are duplicates in the initializer list.
flat_tree& operator=(std::initializer_list<value_type> ilist);
......@@ -634,16 +634,6 @@ flat_tree<Key, GetKeyFromValue, KeyCompare, Container>::flat_tree(
// ----------------------------------------------------------------------------
// Assignments.
template <class Key, class GetKeyFromValue, class KeyCompare, class Container>
auto flat_tree<Key, GetKeyFromValue, KeyCompare, Container>::operator=(
const flat_tree&) -> flat_tree& = default;
template <class Key, class GetKeyFromValue, class KeyCompare, class Container>
auto flat_tree<Key, GetKeyFromValue, KeyCompare, Container>::
operator=(flat_tree&&) noexcept(
std::is_nothrow_move_assignable<container_type>::value)
-> flat_tree& = default;
template <class Key, class GetKeyFromValue, class KeyCompare, class Container>
auto flat_tree<Key, GetKeyFromValue, KeyCompare, Container>::operator=(
std::initializer_list<value_type> ilist) -> flat_tree& {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment