Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_same.hpp
Go to the documentation of this file.
1
// Copyright 2024, Toyota Motor Corporation
2
//
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5
#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_SAME_HPP_
6
#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_SAME_HPP_
7
8
// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9
// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10
11
// IWYU pragma: private, include <type_traits>
12
// IWYU pragma: friend "stdlib_detail/.*"
13
14
#include "
stdlib/include/stdlib_detail/integral_constant.hpp
"
15
16
namespace
std
{
17
/// @brief Trait to detect if the two supplied types are the same or not. The value is @c true if the types are the
18
/// same, @c false otherwise
19
/// @tparam T1 The first type
20
/// @tparam T2 The second type
21
template
<
typename
T1,
typename
T2>
22
extern
constexpr
bool
is_same_v
=
false
;
23
24
/// @brief Trait to detect if the two supplied types are the same or not. The value is @c true if the types are the
25
/// same, @c false otherwise
26
/// @tparam T The type
27
template
<
typename
T>
28
extern
constexpr
bool
is_same_v<T, T>
=
true
;
29
30
/// @brief Trait to detect if the two template parameters are the same or not. The @c value member is @c true if the
31
/// types are the same, @c false otherwise
32
/// @tparam T1 The first type
33
/// @tparam T2 The second type
34
template
<
typename
T1,
typename
T2>
35
class
is_same
:
public
bool_constant
<is_same_v<T1, T2>> {};
36
37
}
// namespace std
38
39
#endif
// INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_SAME_HPP_
std::is_same
Trait to detect if the two template parameters are the same or not. The value member is true if the t...
Definition
is_same.hpp:35
integral_constant.hpp
std
STL namespace.
std::bool_constant
integral_constant< bool, Value > bool_constant
An alias for integral_constant<bool,Value>
Definition
integral_constant.hpp:71
std::is_same_v
constexpr bool is_same_v
Trait to detect if the two supplied types are the same or not. The value is true if the types are the...
stdlib
include
stdlib_detail
is_same.hpp
Generated by
1.13.2