Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@StephanTLavavej
Copy link
Member

While we love const and use it almost everywhere possible, we conventionally omit it in one place. Top-level const on value parameters in function declarations is immediately ignored by the language/compiler and serves no purpose (it makes no difference to callers).

I noticed that we accumulated several occurrences of this in our declarations of parallel algorithms, so I audited all of our _ExPo&& functions. I also noticed one more occurrence in _Buffered_inplace_merge_unchecked(). This is pretty hard to search for, so I don't claim that this is an exhaustive cleanup.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Mar 3, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 3, 2023 19:39
@StephanTLavavej StephanTLavavej self-assigned this Mar 7, 2023
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 7f799dc into microsoft:main Mar 7, 2023
@StephanTLavavej StephanTLavavej deleted the stl-cleanups-top-level-const branch March 7, 2023 19:36
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.

2 participants