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

Xiaoyang Liu via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 21 16:37:22 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
----------------
xiaoyang-sde wrote:

```suggestion
  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Args&&... __args)
```

I think we can make this operator `static`?

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


More information about the libcxx-commits mailing list