This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Ignore vector<bool> in inefficient-vector-operation.
Needs ReviewPublic

Authored by hokein on Jul 24 2017, 1:44 AM.

Details

Reviewers
ilya-biryukov

Event Timeline

hokein created this revision.Jul 24 2017, 1:44 AM
alexfh edited edge metadata.Jul 24 2017, 9:11 AM

Should we look at whether the size is statically known?

Should we look at whether the size is statically known?

(and small enough)

hokein added a comment.Aug 3 2017, 5:03 AM

Should we look at whether the size is statically known?

Do you mean the size of the template type T in vector<T>? STL only provides a template specialization for std::vector<bool>, so I think excluding vector<bool> is probably enough, or am I missing anything here?

alexfh added a comment.Jan 5 2018, 6:33 AM

Should we look at whether the size is statically known?

Do you mean the size of the template type T in vector<T>? STL only provides a template specialization for std::vector<bool>, so I think excluding vector<bool> is probably enough, or am I missing anything here?

I meant the size of the vector, i.e. the number of elements that is going to be pushed into it. Is it still reasonable to exempt vector<bool>, if, say, a million of bools is pushed into it?

alexfh edited reviewers, added: ilya-biryukov; removed: alexfh.Jan 5 2018, 6:33 AM