Skip to content

Prefer (int)a over int(a)#9557

Closed
practicalswift wants to merge 1 commit intobitcoin:masterfrom
practicalswift:avoid-functional-cast-expression
Closed

Prefer (int)a over int(a)#9557
practicalswift wants to merge 1 commit intobitcoin:masterfrom
practicalswift:avoid-functional-cast-expression

Conversation

@practicalswift
Copy link
Copy Markdown
Contributor

No description provided.

@paveljanik
Copy link
Copy Markdown
Contributor

Let's slow down please and let the review part to catch you... thx

@luke-jr
Copy link
Copy Markdown
Member

luke-jr commented Jan 20, 2017

Where is this deprecated? I prefer the current form... :/

@sipa
Copy link
Copy Markdown
Member

sipa commented Jan 20, 2017

I don't like C++ style casts for simple integer types. Sure, C-style casts can be dangerous in general, but for simple types there is no such risk, and result in much less cluttered notation.

I do prefer (int)a over int(a), though.

@practicalswift practicalswift force-pushed the avoid-functional-cast-expression branch from 0eb2e5c to 5da3f42 Compare January 21, 2017 11:24
@practicalswift practicalswift changed the title Use static_cast<new_type>(...) instead of deprecated new_type(...) (functional cast) Prefer (int)a over int(a) Jan 21, 2017
@practicalswift
Copy link
Copy Markdown
Contributor Author

@sipa PR updated accordingly. Looks OK? :-)

@maflcko
Copy link
Copy Markdown
Member

maflcko commented Jan 21, 2017

Our style guide does not mention what is preferred and it does not seem relevant, so tend to NACK.

@practicalswift
Copy link
Copy Markdown
Contributor Author

Closing since consensus seems to be that this change is unnecessary :-)

@practicalswift practicalswift deleted the avoid-functional-cast-expression branch April 10, 2021 19:29
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants