Mark single-argument constructors “explicit” #13769

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:explicit changing 8 files +9 −9
  1. practicalswift commented at 3:18 pm on July 26, 2018: contributor

    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.

  2. Mark single-argument constructors "explicit" 1ac3c983bf
  3. MarcoFalke commented at 3:48 pm on July 26, 2018: member

    Would be nice if explicit was the default for constructors unless you specify otherwise, but I guess we are stuck with cpp currently works.

    Is there was a flag for a compile time warning or similar at least?

  4. MarcoFalke added the label Refactoring on Jul 26, 2018
  5. kallewoof commented at 7:11 pm on July 30, 2018: member
    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.
  6. practicalswift commented at 9:51 am on July 31, 2018: contributor

    Forgot to include this excerpt 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.

  7. MarcoFalke commented at 12:09 pm on July 31, 2018: member
    utACK 1ac3c983bfe06f75542e4f4e30142952802a46d8
  8. promag commented at 1:37 pm on July 31, 2018: member
    utACK 1ac3c98. Are there more candidates?
  9. practicalswift commented at 1:48 pm on July 31, 2018: contributor
    @promag Thanks for reviewing! These should be all AFAIK :-)
  10. Empact commented at 7:35 pm on August 2, 2018: member
    utACK 1ac3c983bfe06f75542e4f4e30142952802a46d8
  11. practicalswift commented at 4:16 pm on August 27, 2018: contributor
    Ready for merge? :-)
  12. MarcoFalke referenced this in commit dd34204611 on Aug 27, 2018
  13. MarcoFalke merged this on Aug 27, 2018
  14. MarcoFalke closed this on Aug 27, 2018

  15. deadalnix referenced this in commit 1d9e07db1b on May 16, 2020
  16. ftrader referenced this in commit 8320077dd5 on Aug 17, 2020
  17. practicalswift deleted the branch on Apr 10, 2021
  18. pravblockc referenced this in commit 9d7e83a113 on Jul 26, 2021
  19. pravblockc referenced this in commit e05eda83f5 on Aug 3, 2021
  20. pravblockc referenced this in commit d68094b3b7 on Aug 3, 2021
  21. gades referenced this in commit 9ba8b9a90a on May 9, 2022
  22. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-05 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me