[compiler-rt] [scudo] Group type traits into a single header (NFC) (PR #118888)
Christopher Ferris via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 16:43:10 PST 2024
================
@@ -0,0 +1,49 @@
+//===-- type_traits.h -------------------------------------------*- 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 SCUDO_TYPE_TRAITS_H_
+#define SCUDO_TYPE_TRAITS_H_
+
+namespace scudo {
+
+template <typename T> struct removeConst {
+ using type = T;
+};
+template <typename T> struct removeConst<const T> {
+ using type = T;
+};
+
+// This is only used for SFINAE when detecting if a type is defined.
+template <typename T> struct voidAdaptor {
+ using type = void;
+};
+
+// This is used for detecting the case that defines the flag with wrong type and
----------------
cferris1000 wrote:
I know this is a copy of the previous comment, but it is worded a bit awkwardly. Perhaps it could be something like:
Used for detecting cases that define the flag with the wrong type, which will lead to an undefined optional flag.
https://github.com/llvm/llvm-project/pull/118888
More information about the llvm-commits
mailing list