Commit rGa17b1aed added bool contains(const key_type& x) const; methods to associative containers, but didn't add template<class K> bool contains(const K& x) const; for heterogenous lookup.
Details
- Reviewers
zoecarver • Quuxplusone ldionne - Group Reviewers
Restricted Project - Commits
- rG3fca07d7b9a2: [libc++] [P0458] Add map::contains and set::contains for heterogenous lookup…
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/map | ||
---|---|---|
1419 | Hmmm, just looking at other files and wondering. Should I use _EnableIf? |
LGTM % whitespace nits.
libcxx/include/map | ||
---|---|---|
199–200 | Nit: add an extra space before // C++20 on line 199 so that all the comments line up. Ditto line 418. | |
1419 | FWIW I'd say yes, but throughout; so in a separate PR if at all. See for example 199d2ebeed8382071809983f016e482b1d013b62 where I went through and _EnableIf'ed all the deduction guides. We could do the same kind of NFC-commit here. Or we could just say "meh, nvm for now." | |
libcxx/include/set | ||
162–163 | Line 162 is missing a space before contains, if you were trying to get the semicolons to line up. (I care about aligning the comments; I don't care about aligning the semicolons.) Ditto line 367. | |
809–814 | Here and throughout, it would be more consistent with the surrounding style to do the function on one line: template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,bool>::type contains(const _K2& __k) const {return find(__k) != end();} |
Nit: add an extra space before // C++20 on line 199 so that all the comments line up. Ditto line 418.