From 522606b7fae37836c138e83f6eec0eabb9947dc0 Mon Sep 17 00:00:00 2001 From: Evan Brown Date: Thu, 8 Dec 2022 14:15:12 -0800 Subject: Fix some ClangTidy warnings in raw_hash_set code. PiperOrigin-RevId: 493993005 Change-Id: I0705be8678022a9e08a1af9972687b7955593994 --- absl/container/internal/raw_hash_set.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'absl/container/internal/raw_hash_set.h') diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index ddb8f6be..8a33106f 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -1300,9 +1300,9 @@ class raw_hash_set { using pointer = typename raw_hash_set::const_pointer; using difference_type = typename raw_hash_set::difference_type; - const_iterator() {} + const_iterator() = default; // Implicit construction from iterator. - const_iterator(iterator i) : inner_(std::move(i)) {} + const_iterator(iterator i) : inner_(std::move(i)) {} // NOLINT reference operator*() const { return *inner_; } pointer operator->() const { return inner_.operator->(); } @@ -1330,6 +1330,8 @@ class raw_hash_set { using node_type = node_handle, Alloc>; using insert_return_type = InsertReturnType; + // Note: can't use `= default` due to non-default noexcept (causes + // problems for some compilers). NOLINTNEXTLINE raw_hash_set() noexcept( std::is_nothrow_default_constructible::value&& std::is_nothrow_default_constructible::value&& @@ -1494,6 +1496,7 @@ class raw_hash_set { std::is_nothrow_move_assignable::value) { // TODO(sbenza): We should only use the operations from the noexcept clause // to make sure we actually adhere to that contract. + // NOLINTNEXTLINE: not returning *this for performance. return move_assign( std::move(that), typename AllocTraits::propagate_on_container_move_assignment()); -- cgit v1.2.3