Path: blob/main/contrib/llvm-project/libcxx/include/__utility/as_const.h
35236 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___UTILITY_AS_CONST_H9#define _LIBCPP___UTILITY_AS_CONST_H1011#include <__config>12#include <__type_traits/add_const.h>13#include <__utility/forward.h>14#include <__utility/move.h>1516#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17# pragma GCC system_header18#endif1920_LIBCPP_BEGIN_NAMESPACE_STD2122#if _LIBCPP_STD_VER >= 1723template <class _Tp>24[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept {25return __t;26}2728template <class _Tp>29void as_const(const _Tp&&) = delete;30#endif3132_LIBCPP_END_NAMESPACE_STD3334#endif // _LIBCPP___UTILITY_AS_CONST_H353637