[libcxx-commits] [libcxx] [libc++][type_traits] Implements "A type trait to detect reference binding to temporary" (PR #128649)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 6 02:16:40 PST 2025
================
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_REFERENCE_CONSTRUCTS_FROM_TEMPORARY_H
+#define _LIBCPP___TYPE_TRAITS_REFERENCE_CONSTRUCTS_FROM_TEMPORARY_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_HAS_REFERENCE_CONSTRUCTS_FROM_TEMPORARY
+
+template <class _Tp, class _Up>
+const bool __reference_constructs_from_temporary_v = __reference_constructs_from_temporary(_Tp, _Up);
----------------
philnik777 wrote:
We don't need to introduce private names if we don't actually use them.
https://github.com/llvm/llvm-project/pull/128649
More information about the libcxx-commits
mailing list