[PATCH] D93912: [libc++][P1679] add string contains

Mark de Wever via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 08:47:41 PST 2021


Mordante added a comment.

In D93912#2474869 <https://reviews.llvm.org/D93912#2474869>, @WimLeflere wrote:

> Where are the feature test macros defined?
> `__cpp_lib_string_contains` should be added

The macro should be added to `libcxx/utils/generate_feature_test_macro_components.py`, then run the script to generate the proper macros and tests.



================
Comment at: libcxx/include/string:1442
+    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    bool contains(__self_view __sv) const _NOEXCEPT
+    { return __self_view(data(), size()).contains(__sv); }
----------------
Wouldn't it be better to use `constexpr` and `noexcept` since the code is never compiled using C++98.


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

https://reviews.llvm.org/D93912



More information about the llvm-commits mailing list