tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_object.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_TYPE_TRAITS_IS_OBJECT_HPP
4#define TETL_TYPE_TRAITS_IS_OBJECT_HPP
5
6#include <etl/_config/all.hpp>
7
13
14namespace etl {
15
19template <typename T>
20struct is_object;
21
22#if __has_builtin(__is_object)
23template <typename T>
24struct is_object : bool_constant<__is_object(T)> { };
25
26template <typename T>
27inline constexpr bool is_object_v = __is_object(T);
28
29#else
30
31template <typename T>
32struct is_object : bool_constant<is_scalar_v<T> or is_array_v<T> or is_union_v<T> or is_class_v<T> > { };
33
34template <typename T>
35inline constexpr bool is_object_v = is_object<T>::value;
36
37#endif
38} // namespace etl
39
40#endif // TETL_TYPE_TRAITS_IS_OBJECT_HPP
Definition adjacent_find.hpp:8
constexpr bool is_object_v
Definition is_object.hpp:35
integral_constant< bool, B > bool_constant
Definition bool_constant.hpp:11
static constexpr bool value
Definition integral_constant.hpp:10
If T is an object type (that is any possibly cv-qualified type other than function,...
Definition is_object.hpp:32