Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

readability check to suggest usage of sequence containers front()/back() #37657

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR38684
Status NEW
Importance P enhancement
Reported by Eugene Zelenko (eugene.zelenko@gmail.com)
Reported on 2018-08-23 17:34:08 -0700
Last modified on 2018-11-30 14:07:21 -0800
Version unspecified
Hardware All All
CC alexfh@google.com, djasper@google.com, klimek@google.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
It'll be great to have readability check which will suggest to replace next
patterns for containers:

*container.begin()

to

container.front()

*container.rbegin()

to

container.back()

Same for cbegin()/crbegin()
Quuxplusone commented 6 years ago
Other useful replacement for vector/array/deque is:

*( container.begin() + <integer constant> )

to

container.at( <integer constant> )

Same for cbegin().
Quuxplusone commented 5 years ago

See also bug 27905.