Path: blob/main/contrib/llvm-project/libcxx/include/__utility/declval.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_DECLVAL_H9#define _LIBCPP___UTILITY_DECLVAL_H1011#include <__config>1213#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)14# pragma GCC system_header15#endif1617_LIBCPP_BEGIN_NAMESPACE_STD1819// Suppress deprecation notice for volatile-qualified return type resulting20// from volatile-qualified types _Tp.21_LIBCPP_SUPPRESS_DEPRECATED_PUSH22template <class _Tp>23_Tp&& __declval(int);24template <class _Tp>25_Tp __declval(long);26_LIBCPP_SUPPRESS_DEPRECATED_POP2728template <class _Tp>29_LIBCPP_HIDE_FROM_ABI decltype(std::__declval<_Tp>(0)) declval() _NOEXCEPT {30static_assert(!__is_same(_Tp, _Tp),31"std::declval can only be used in an unevaluated context. "32"It's likely that your current usage is trying to extract a value from the function.");33}3435_LIBCPP_END_NAMESPACE_STD3637#endif // _LIBCPP___UTILITY_DECLVAL_H383940