Mark single-argument constructors "explicit"#13769
Conversation
|
Would be nice if Is there was a flag for a compile time warning or similar at least? |
|
Concept ACK (unexpected implicit promotions are bad and 9 lines is OK), assuming there is a compile flag or non-false-positive-inducing linter that can plug this. |
|
Forgot to include this excerpt from the developer notes:
|
|
utACK 1ac3c98 |
|
utACK 1ac3c98. Are there more candidates? |
|
@promag Thanks for reviewing! These should be all AFAIK :-) |
|
utACK 1ac3c98 |
|
Ready for merge? :-) |
1ac3c98 Mark single-argument constructors "explicit" (practicalswift) Pull request description: Mark single-argument constructors `explicit`. Rationale: * Avoid unexpected implicit promotions. From the developer notes: > **By default, declare single-argument constructors explicit.** > Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions. Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
Summary: bitcoin/bitcoin@1ac3c98 --- This is a backport of Core [[bitcoin/bitcoin#13769 | PR13769]] Test Plan: ninja check-all Reviewers: #bitcoin_abc, nakihito Reviewed By: nakihito Differential Revision: https://reviews.bitcoinabc.org/D6072
Summary: bitcoin/bitcoin@1ac3c98 --- This is a backport of Core [[bitcoin/bitcoin#13769 | PR13769]] Test Plan: ninja check-all Reviewers: #bitcoin_abc, nakihito Reviewed By: nakihito Differential Revision: https://reviews.bitcoinabc.org/D6072
1ac3c98 Mark single-argument constructors "explicit" (practicalswift) Pull request description: Mark single-argument constructors `explicit`. Rationale: * Avoid unexpected implicit promotions. From the developer notes: > **By default, declare single-argument constructors explicit.** > Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions. Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
1ac3c98 Mark single-argument constructors "explicit" (practicalswift) Pull request description: Mark single-argument constructors `explicit`. Rationale: * Avoid unexpected implicit promotions. From the developer notes: > **By default, declare single-argument constructors explicit.** > Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions. Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
1ac3c98 Mark single-argument constructors "explicit" (practicalswift) Pull request description: Mark single-argument constructors `explicit`. Rationale: * Avoid unexpected implicit promotions. From the developer notes: > **By default, declare single-argument constructors explicit.** > Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions. Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
Mark single-argument constructors
explicit.Rationale:
From the developer notes: