Debian Codegraph @

src/mpt/base/type_traits.hpp

raw
1 /* SPDX-License-Identifier: BSL-1.0 OR BSD-3-Clause */
2
3 #ifndef MPT_BASE_TYPE_TRAITS_HPP
4 #define MPT_BASE_TYPE_TRAITS_HPP
5
6
7
8 #include "mpt/base/detect.hpp"
9 #include "mpt/base/namespace.hpp"
10
11 #include <type_traits>
12
13
14
15 namespace mpt {
16 inline namespace MPT_INLINE_NS {
17
18
19
20 #if MPT_CXX_AT_LEAST(20)
21
22 using std::type_identity;
23
24 #else // ! C++20
25
26 template <typename T>
27 struct type_identity {
28 using type = T;
29 };
30
31 #endif // C++20
32
33
34
35 } // namespace MPT_INLINE_NS
36 } // namespace mpt
37
38
39
40 #endif // MPT_BASE_TYPE_TRAITS_HPP