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

fix!: avoid single-arg forwarding c'tor #1233

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

devjgm
Copy link
Contributor

@devjgm devjgm commented Feb 3, 2020

Single-argument forwarding constructors can hide implicitly generated
copy/move constructors. Even if this issue is avoided with the proper
use of SFINAE, clang-tidy may still complain (incorrectly, I think).
http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forwarding-reference-overload.html

To fix this I renamed the class StreamOf -> TupleStream. I then
changed its constructor to accept two iterators instead of a single
range. Then I added a StreamOf<T>() non-member factory function. This
should make it so our existing uses all continue to work.

So, this really shouldn't be much of an API break.


This change is Reviewable

Single-argument forwarding constructors can hide implicitly generated
copy/move constructors. Even if this issue is avoided with the proper
use of SFINAE, clang-tidy may still complain (incorrectly, I think).
http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forwarding-reference-overload.html

To fix this I renamed the class `StreamOf` -> `TupleStream`. I then
changed its constructor to accept to iterators instead of a single
range. Then I added a `StreamOf<T>()` non-member factory function. This
should make it so our existing uses all continue to work.

So, this really shouldn't be much of an API break.
@devjgm devjgm requested a review from coryan February 3, 2020 18:34
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 3, 2020
@devjgm devjgm marked this pull request as ready for review February 3, 2020 18:54
@codecov
Copy link

codecov bot commented Feb 3, 2020

Codecov Report

Merging #1233 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1233      +/-   ##
==========================================
- Coverage   94.97%   94.92%   -0.06%     
==========================================
  Files         184      184              
  Lines       13820    13821       +1     
==========================================
- Hits        13125    13119       -6     
- Misses        695      702       +7
Impacted Files Coverage Δ
google/cloud/spanner/row.h 90% <100%> (+0.25%) ⬆️
google/cloud/spanner/row_test.cc 100% <100%> (ø) ⬆️
...on_tests/rpc_failure_threshold_integration_test.cc 85.71% <0%> (-2.07%) ⬇️
...ud/spanner/integration_tests/client_stress_test.cc 82.45% <0%> (-0.88%) ⬇️
google/cloud/spanner/client.cc 96.55% <0%> (-0.87%) ⬇️
google/cloud/spanner/samples/samples.cc 87.57% <0%> (-0.29%) ⬇️
google/cloud/spanner/value.h 92.8% <0%> (-0.11%) ⬇️
.../spanner/benchmarks/multiple_rows_cpu_benchmark.cc 92.36% <0%> (ø) ⬆️
...anner/integration_tests/client_integration_test.cc 98.48% <0%> (ø) ⬆️
google/cloud/spanner/instance_admin_connection.h
... and 1 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 e07fd0d...59b684e. Read the comment docs.

Copy link
Member

@coryan coryan 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 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@devjgm devjgm merged commit 4b9aa17 into googleapis:master Feb 3, 2020
@devjgm devjgm deleted the fix-streamof branch February 3, 2020 19:41
@devjgm
Copy link
Contributor Author

devjgm commented Feb 3, 2020

Related to #355

devjgm added a commit to devjgm/google-cloud-cpp that referenced this pull request May 7, 2020
…spanner#1233)

Single-argument forwarding constructors can hide implicitly generated
copy/move constructors. Even if this issue is avoided with the proper
use of SFINAE, clang-tidy may still complain (incorrectly, I think).
http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forwarding-reference-overload.html

To fix this I renamed the class `StreamOf` -> `TupleStream`. I then
changed its constructor to accept to iterators instead of a single
range. Then I added a `StreamOf<T>()` non-member factory function. This
should make it so our existing uses all continue to work.

So, this really shouldn't be much of an API break.
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.

None yet

3 participants