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_CONJUNCTION_H
10#define _LIBCPP___TYPE_TRAITS_CONJUNCTION_H
11
12#include <__config>
13#include <__type_traits/conditional.h>
14#include <__type_traits/enable_if.h>
15#include <__type_traits/integral_constant.h>
16
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18# pragma GCC system_header
19#endif
20
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23#if _LIBCPP_STD_VER > 14
24
25template <class _Arg, class... _Args>
26struct __conjunction_impl {
27 using type = conditional_t<!bool(_Arg::value), _Arg, typename __conjunction_impl<_Args...>::type>;
28};
29
30template <class _Arg>
31struct __conjunction_impl<_Arg> {
32 using type = _Arg;
33};
34
35template <class... _Args>
36struct conjunction : __conjunction_impl<true_type, _Args...>::type {};
37
38template<class... _Args>
39inline constexpr bool conjunction_v = conjunction<_Args...>::value;
40
41#endif // _LIBCPP_STD_VER > 14
42
43template <class...>
44using __expand_to_true = true_type;
45
46template <class... _Pred>
47__expand_to_true<__enable_if_t<_Pred::value>...> __and_helper(int);
48
49template <class...>
50false_type __and_helper(...);
51
52template <class... _Pred>
53using _And _LIBCPP_NODEBUG = decltype(__and_helper<_Pred...>(0));
54
55_LIBCPP_END_NAMESPACE_STD
56
57#endif // _LIBCPP___TYPE_TRAITS_CONJUNCTION_H
58

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