[libcxx-commits] [libcxx] [libc++] Add the __is_replaceable type trait (PR #132408)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 21 12:16:20 PDT 2025


================
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 _LIBCPP___TYPE_TRAITS_IS_REPLACEABLE_H
+#define _LIBCPP___TYPE_TRAITS_IS_REPLACEABLE_H
+
+#include <__config>
+#include <__type_traits/enable_if.h>
+#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_trivially_copyable.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
----------------
mordante wrote:

I wonder should we already offer `template< class T > struct is_replaceable;` and `template< class T > inline constexpr bool is_replaceable_v = is_replaceable<T>::value;` or do you want to wait for proper compiler support?

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


More information about the libcxx-commits mailing list