Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_enum.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_ENUM_HPP_
6
#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_ENUM_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 Type trait to check if a type is an enumeration. @c true if it is, @c false otherwise
18
/// @tparam Type The type to check
19
template
<
typename
Type>
20
extern
constexpr
bool
is_enum_v
= __is_enum(Type);
21
22
/// @brief Type trait to check if a type is an enumeration. Derives from @c std::true_type if it is, @c std::false_type
23
/// otherwise
24
/// @tparam Type The type to check
25
template
<
typename
Type>
26
class
is_enum
:
public
bool_constant
<is_enum_v<Type>> {};
27
28
}
// namespace std
29
30
#endif
// INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_ENUM_HPP_
std::is_enum
Type trait to check if a type is an enumeration. Derives from std::true_type if it is,...
Definition
is_enum.hpp:26
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_enum_v
constexpr bool is_enum_v
Type trait to check if a type is an enumeration. true if it is, false otherwise.
stdlib
include
stdlib_detail
is_enum.hpp
Generated by
1.13.2