[libcxx-commits] [libcxx] [libc++][functional] Implement `not_fn<NTTP>` (PR #86133)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 21 23:02:52 PDT 2024


================
@@ -48,6 +50,27 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 auto not_fn(_Fn&& __f) {
 
 #endif // _LIBCPP_STD_VER >= 17
 
+#if _LIBCPP_STD_VER >= 26
+
+template <auto _Fn>
+struct __nttp_not_fn_t {
+  template <class... _Args>
+  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const
----------------
frederick-vs-ja wrote:

 `volatile` values can be rejected by not using `static`, but this doesn't seem worthwhile... See [[func.require]/4](https://eel.is/c++draft/func.require#4) and [LWG4007](https://cplusplus.github.io/LWG/issue4007).

https://github.com/llvm/llvm-project/pull/86133


More information about the libcxx-commits mailing list