Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:57

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___NEW_LAUNDER_H
0010 #define _LIBCPP___NEW_LAUNDER_H
0011 
0012 #include <__config>
0013 #include <__type_traits/is_function.h>
0014 #include <__type_traits/is_void.h>
0015 
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 #  pragma GCC system_header
0018 #endif
0019 
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021 template <class _Tp>
0022 [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT {
0023   static_assert(!(is_function<_Tp>::value), "can't launder functions");
0024   static_assert(!is_void<_Tp>::value, "can't launder cv-void");
0025   return __builtin_launder(__p);
0026 }
0027 
0028 #if _LIBCPP_STD_VER >= 17
0029 template <class _Tp>
0030 [[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp* launder(_Tp* __p) noexcept {
0031   return std::__launder(__p);
0032 }
0033 #endif
0034 _LIBCPP_END_NAMESPACE_STD
0035 
0036 #endif // _LIBCPP___NEW_LAUNDER_H