libzypp: zypp-core/base/TypeTraits.h Source File

libzypp 17.38.6

TypeTraits.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_TYPETRAITS_H
12#define ZYPP_TYPETRAITS_H
13
14#include <type_traits>
15
17// Helper types from https://en.cppreference.com/
18namespace std
19{
20#if __cplusplus < 202002L
21
22#endif // __cplusplus < 202002L
23
24
25#if __cplusplus < 201703L
26 template< class Base, class Derived >
27 inline constexpr bool is_base_of_v = is_base_of<Base, Derived>::value;
28
29 template< class T >
30 inline constexpr bool is_integral_v = is_integral<T>::value;
31
32 template< class T >
33 inline constexpr bool is_pointer_v = is_pointer<T>::value;
34#endif // __cplusplus < 201703L
35
36
37#if __cplusplus < 201402L
38 template< bool B, class T, class F >
39 using conditional_t = typename conditional<B,T,F>::type;
40
41 template< class T >
42 using decay_t = typename decay<T>::type;
43
44 template< bool B, class T = void >
45 using enable_if_t = typename enable_if<B,T>::type;
46
47 template< class T >
48 using remove_reference_t = typename remove_reference<T>::type;
49
50 template< class T >
51 using result_of_t = typename result_of<T>::type;
52
53 template< class T >
54 using underlying_type_t = typename underlying_type<T>::type;
55#endif // __cplusplus < 201402L
56} // namespace std
58#endif // ZYPP_TYPETRAITS_H
std
Definition ansi.h:855
std::decay_t
typename decay< T >::type decay_t
Definition TypeTraits.h:42
std::underlying_type_t
typename underlying_type< T >::type underlying_type_t
Definition TypeTraits.h:54
std::enable_if_t
typename enable_if< B, T >::type enable_if_t
Definition TypeTraits.h:45
std::is_pointer_v
constexpr bool is_pointer_v
Definition TypeTraits.h:33
std::is_base_of_v
constexpr bool is_base_of_v
Definition TypeTraits.h:27
std::is_integral_v
constexpr bool is_integral_v
Definition TypeTraits.h:30
std::conditional_t
typename conditional< B, T, F >::type conditional_t
Definition TypeTraits.h:39
std::result_of_t
typename result_of< T >::type result_of_t
Definition TypeTraits.h:51
std::remove_reference_t
typename remove_reference< T >::type remove_reference_t
Definition TypeTraits.h:48