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
16namespace 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
21template <typename T1, typename T2>
22extern 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
27template <typename T>
28extern 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
34template <typename T1, typename T2>
35class 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_
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
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...
constexpr bool is_same_v< T, T >
Trait to detect if the two supplied types are the same or not. The value is true if the types are the...
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition result.hpp:1827