xref: /llvm-project/libc/src/__support/CPP/type_traits/is_same.h (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
1 //===-- is_same type_traits -------------------------------------*- C++ -*-===//
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 #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_SAME_H
9 #define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_SAME_H
10 
11 #include "src/__support/CPP/type_traits/false_type.h"
12 #include "src/__support/CPP/type_traits/true_type.h"
13 #include "src/__support/macros/attributes.h"
14 #include "src/__support/macros/config.h"
15 
16 namespace LIBC_NAMESPACE_DECL {
17 namespace cpp {
18 
19 // is_same
20 template <typename T, typename U> struct is_same : cpp::false_type {};
21 template <typename T> struct is_same<T, T> : cpp::true_type {};
22 template <typename T, typename U>
23 LIBC_INLINE_VAR constexpr bool is_same_v = is_same<T, U>::value;
24 
25 } // namespace cpp
26 } // namespace LIBC_NAMESPACE_DECL
27 
28 #endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_SAME_H
29