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

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 4 07:59:04 PDT 2019


zoecarver marked an inline comment as done.
zoecarver added inline comments.


================
Comment at: include/map:1408
+
+    _LIBCPP_INLINE_VISIBILITY
+    bool contains(const key_type& __k) const {return find(__k) != end();}
----------------
ldionne wrote:
> 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.
Will do.


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

https://reviews.llvm.org/D59344





More information about the libcxx-commits mailing list