Skip to content

Code cleanup: Brace for impact - #1020

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:masterfrom
StephanTLavavej:braces
Jul 11, 2020
Merged

Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:masterfrom
StephanTLavavej:braces

Conversation

@StephanTLavavej

Copy link
Copy Markdown
Member

We're increasingly using braces to construct temporary objects in product code. This makes expressions more readable because braces don't look like function calls.

This PR changes all occurrences of meow<>() to meow<>{} (missed by previous rounds of search-and-replace due to the "diamond"). These are the transparent operator function objects (primarily equal_to and less, also a few plus, minus, and multiplies in ).

Then, this changes meow<>{} to meow{} in C++17-and-later code, where Class Template Argument Deduction is available. (We were already using meow{} in a few places, so this is increasing consistency. Of course, this creates a difference between C++14 and C++17 styles, but I think it's reasonable to take advantage of CTAD when possible.)

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the enhancement Something can be improved label Jul 8, 2020
@miscco

Copy link
Copy Markdown
Contributor

Engage_meme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants