Skip to content

[codemod] Add explicit to conversions#9336

Closed
goldsborough wants to merge 1 commit intopytorch:masterfrom
goldsborough:explicit-operator-bool
Closed

[codemod] Add explicit to conversions#9336
goldsborough wants to merge 1 commit intopytorch:masterfrom
goldsborough:explicit-operator-bool

Conversation

@goldsborough
Copy link
Contributor

Another code-mod for clang-tidy: Conversion operators should be marked explicit so that they don't cause unwanted implicit conversions. This is especially important for operator bool(), see https://stackoverflow.com/questions/39995573/when-can-i-use-explicit-operator-bool-without-a-cast

@ezyang @apaszke

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@goldsborough goldsborough deleted the explicit-operator-bool branch July 11, 2018 22:53
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
Another code-mod for clang-tidy: Conversion operators should be marked explicit so that they don't cause unwanted implicit conversions. This is especially important for `operator bool()`, see https://stackoverflow.com/questions/39995573/when-can-i-use-explicit-operator-bool-without-a-cast

ezyang apaszke
Pull Request resolved: pytorch#9336

Reviewed By: apaszke

Differential Revision: D8807065

Pulled By: goldsborough

fbshipit-source-id: 0e9f4ebd0048a2a510c0d05fa410695d7e977eb1
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants