[libcxx-commits] [PATCH] D59344: Add contains method to map types

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 4 07:52:14 PDT 2019


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: include/map:1408
+
+    _LIBCPP_INLINE_VISIBILITY
+    bool contains(const key_type& __k) const {return find(__k) != end();}
----------------
jloser wrote:
> I think we should only provide the declaration and definition of `contains` when `_LIBCPP_STD_VER > 17`. Otherwise, someone compiling with trunk and `-std=c++14` would be able to use `contains`, and this is only meant for C++20 or later.
Hmm yes, this was the intent but somehow I missed that during the review. Please only enable in C++20 and above.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59344/new/

https://reviews.llvm.org/D59344





More information about the libcxx-commits mailing list