Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

style: cleanup use of noexcept, explicit and = default #1209

Merged
merged 1 commit into from
Jan 22, 2020

Conversation

devbww
Copy link
Contributor

@devbww devbww commented Jan 22, 2020

Our current rule-of-thumb is to only specify noexcept on hand-written
move constructors and assignments. So, remove two current specifications
on defaulted move operators, and one on a normal constructor. Fixes #228.

Reserve explicit for single-argument constructors. Some ctor-arity
has changed over time, so some explicit annotations were missing or
outdated.

Also rewrite any T() {} constructor as T() = default.


This change is Reviewable

Our current rule-of-thumb is to only specify `noexcept` on hand-written
move constructors and assignments.  So, remove two current specifications
on defaulted move operators, and one on a normal constructor.  Fixes googleapis#228.

Reserve `explicit` for single-argument constructors.  Some ctor-arity
has changed over time, so some `explicit` annotations were missing or
outdated.

Also rewrite any `T() {}` constructor as `T() = default`.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 22, 2020
@codecov
Copy link

codecov bot commented Jan 22, 2020

Codecov Report

Merging #1209 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1209      +/-   ##
==========================================
+ Coverage   95.61%   95.61%   +<.01%     
==========================================
  Files         179      179              
  Lines       13643    13644       +1     
==========================================
+ Hits        13045    13046       +1     
  Misses        598      598
Impacted Files Coverage Δ
google/cloud/spanner/row.h 89.74% <ø> (ø) ⬆️
google/cloud/spanner/query_partition.h 100% <ø> (ø) ⬆️
...le/cloud/spanner/internal/instance_admin_logging.h 100% <100%> (ø) ⬆️
...le/cloud/spanner/create_instance_request_builder.h 100% <100%> (ø) ⬆️
...le/cloud/spanner/internal/database_admin_logging.h 100% <100%> (ø) ⬆️
...cloud/spanner/internal/logging_result_set_reader.h 100% <100%> (ø) ⬆️
google/cloud/spanner/mutations.h 100% <100%> (ø) ⬆️
google/cloud/spanner/internal/transaction_impl.h 100% <100%> (ø) ⬆️
google/cloud/spanner/bytes.h 100% <100%> (ø) ⬆️
...ogle/cloud/spanner/internal/logging_spanner_stub.h 100% <100%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a03fc2...349e62a. Read the comment docs.

@devbww devbww marked this pull request as ready for review January 22, 2020 21:15
@devbww devbww requested a review from mr-salty January 22, 2020 21:16
Copy link
Contributor

@mr-salty mr-salty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 14 of 14 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@devbww devbww merged commit 05a2e3a into googleapis:master Jan 22, 2020
@devbww devbww deleted the noexcept branch January 22, 2020 22:52
devjgm pushed a commit to devjgm/google-cloud-cpp that referenced this pull request May 7, 2020
…pis/google-cloud-cpp-spanner#1209)

Our current rule-of-thumb is to only specify `noexcept` on hand-written
move constructors and assignments.  So, remove two current specifications
on defaulted move operators, and one on a normal constructor.  Fixes googleapis/google-cloud-cpp-spanner#228.

Reserve `explicit` for single-argument constructors.  Some ctor-arity
has changed over time, so some `explicit` annotations were missing or
outdated.

Also rewrite any `T() {}` constructor as `T() = default`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit use (or lack of use) of noexcept
3 participants