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// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_TYPE_TRAITS_IS_OBJECT_HPP
5#define TETL_TYPE_TRAITS_IS_OBJECT_HPP
6
7#include <etl/_config/all.hpp>
8
9#include <etl/_type_traits/bool_constant.hpp>
10#include <etl/_type_traits/is_array.hpp>
11#include <etl/_type_traits/is_class.hpp>
12#include <etl/_type_traits/is_scalar.hpp>
13#include <etl/_type_traits/is_union.hpp>
14
15namespace etl {
16
17/// \brief If T is an object type (that is any possibly cv-qualified type other
18/// than function, reference, or void types), provides the member constant value
19/// equal true. For any other type, value is false.
20template <typename T>
21struct is_object;
22
23#if __has_builtin(__is_object)
24template <typename T>
25struct is_object : bool_constant<__is_object(T)> { };
26
27template <typename T>
28inline constexpr bool is_object_v = __is_object(T);
29
30#else
31
32template <typename T>
34
35template <typename T>
36inline constexpr bool is_object_v = is_object<T>::value;
37
38#endif
39} // namespace etl
40
41#endif // TETL_TYPE_TRAITS_IS_OBJECT_HPP
Definition adjacent_find.hpp:9