[llvm] [libc] Add invoke / invoke_result type traits (PR #65750)

Clement Courbet via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 05:50:00 PDT 2023


================
@@ -0,0 +1,58 @@
+//===-- invoke type_traits --------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_INVOKE_H
+#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_INVOKE_H
+
+#include "src/__support/CPP/type_traits/decay.h"
+#include "src/__support/CPP/type_traits/is_base_of.h"
+#include "src/__support/CPP/utility/forward.h"
+
+// BEWARE : this implementation is not fully conformant as it doesn't take
+// `cpp::reference_wrapper` into account.
+
+namespace __llvm_libc::cpp {
+
+namespace detail {
+
+// Catch all function types.
----------------
legrosbuffle wrote:

Comment is misleading: This includes functors too.

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


More information about the llvm-commits mailing list