1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H
10#define _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H
11
12#include <__config>
13
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header
16#endif
17
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20template <class _Tp, _Tp __v>
21struct _LIBCPP_TEMPLATE_VIS integral_constant
22{
23 static _LIBCPP_CONSTEXPR const _Tp value = __v;
24 typedef _Tp value_type;
25 typedef integral_constant type;
26 _LIBCPP_INLINE_VISIBILITY
27 _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
28#if _LIBCPP_STD_VER > 11
29 _LIBCPP_INLINE_VISIBILITY
30 constexpr value_type operator ()() const _NOEXCEPT {return value;}
31#endif
32};
33
34template <class _Tp, _Tp __v>
35_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
36
37typedef integral_constant<bool, true> true_type;
38typedef integral_constant<bool, false> false_type;
39
40template <bool _Val>
41using _BoolConstant _LIBCPP_NODEBUG = integral_constant<bool, _Val>;
42
43#if _LIBCPP_STD_VER > 14
44template <bool __b>
45using bool_constant = integral_constant<bool, __b>;
46#endif
47
48_LIBCPP_END_NAMESPACE_STD
49
50#endif // _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H
51

source code of flutter_engine/third_party/libcxx/include/__type_traits/integral_constant.h