1 /* ///////////////////////////////////////////////////////////////////////
2 * File: initialiser_selector.h
7 * Brief: initialiser_selector class
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 #ifndef EXTL_MEMORY_INITIALISER_SELECTOR_H
14 #define EXTL_MEMORY_INITIALISER_SELECTOR_H
16 /*!\file initialiser_selector.h
17 * \brief initialiser_selector class
20 # error initialiser_selector.h need be supported by c++.
23 /* ///////////////////////////////////////////////////////////////////////
27 #include "object_initialiser.h"
28 #include "pod_initialiser.h"
30 #include "../type/traits/is_arithmetic.h"
32 #ifdef EXTL_TYPE_TRAITS_IS_POD_SUPPORT
33 # include "../type/traits/is_pod.h"
36 #ifdef EXTL_TYPE_TRAITS_IS_SCALAR_SUPPORT
37 # include "../type/traits/is_scalar.h"
40 #ifdef EXTL_MPL_IF_SUPPORT
41 # include "../mpl/if_.h"
44 /* ///////////////////////////////////////////////////////////////////////
49 /*!\brief initialiser_selector class
51 * \param T The value type
53 * \ingroup extl_group_memory
55 template<typename_param_k T
>
56 struct initialiser_selector
58 #ifdef EXTL_MPL_IF_SUPPORT
59 #if defined(EXTL_TYPE_TRAITS_IS_POD_SUPPORT)
60 typedef typename_type_k
EXTL_NS_MPL(if_
)< (is_pod
<T
>::value
)
62 , object_initialiser
<T
>
63 >::type initialiser_type
;
65 #elif defined(EXTL_TYPE_TRAITS_IS_SCALAR_SUPPORT)
66 typedef typename_type_k
EXTL_NS_MPL(if_
)< (is_scalar
<T
>::value
)
68 , object_initialiser
<T
>
69 >::type initialiser_type
;
72 typedef typename_type_k
EXTL_NS_MPL(if_
)< (is_arithmetic
<T
>::value
)
74 , object_initialiser
<T
>
75 >::type initialiser_type
;
78 typedef object_initialiser
<T
> initialiser_type
;
81 /* ///////////////////////////////////////////////////////////////////////
86 /* //////////////////////////////////////////////////////////////////// */
87 #endif /* EXTL_MEMORY_INITIALISER_SELECTOR_H */
88 /* //////////////////////////////////////////////////////////////////// */