31
|
1 |
#ifndef _STLP_PTRS_SPECIALIZE_H
|
|
2 |
#define _STLP_PTRS_SPECIALIZE_H
|
|
3 |
|
|
4 |
#ifndef _STLP_TYPE_TRAITS_H
|
|
5 |
# include <stl/type_traits.h>
|
|
6 |
#endif
|
|
7 |
|
|
8 |
// the following is a workaround for arrow operator problems
|
|
9 |
#if defined ( _STLP_NO_ARROW_OPERATOR )
|
|
10 |
// User wants to disable proxy -> operators
|
|
11 |
# define _STLP_DEFINE_ARROW_OPERATOR
|
|
12 |
# define _STLP_ARROW_SPECIALIZE_WITH_PTRS(_Tp)
|
|
13 |
#else
|
|
14 |
// Compiler can handle generic -> operator.
|
|
15 |
# define _STLP_ARROW_SPECIALIZE_WITH_PTRS(_Tp)
|
|
16 |
# if defined (__BORLANDC__)
|
|
17 |
# define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { return &(*(*this)); }
|
|
18 |
# elif defined(__WATCOMC__)
|
|
19 |
# define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { reference x = operator*(); return &x; }
|
|
20 |
# else
|
|
21 |
# define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { return &(operator*()); }
|
|
22 |
# endif
|
|
23 |
#endif /* _STLP_NO_ARROW_OPERATOR */
|
|
24 |
|
|
25 |
// Important pointers specializations
|
|
26 |
|
|
27 |
#ifdef _STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS
|
|
28 |
# define _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(_Type)
|
|
29 |
# define _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type)
|
|
30 |
#else
|
|
31 |
# define _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type) _STLP_TEMPLATE_NULL struct __type_traits<_Type> : __type_traits_aux<1> {};
|
|
32 |
# define _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(_Type) \
|
|
33 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type*) \
|
|
34 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(const _Type*) \
|
|
35 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type**) \
|
|
36 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type* const *) \
|
|
37 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(const _Type**) \
|
|
38 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type***) \
|
|
39 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE(const _Type***)
|
|
40 |
#endif
|
|
41 |
|
|
42 |
# define _STLP_POINTERS_SPECIALIZE(_Type) _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(_Type) _STLP_ARROW_SPECIALIZE_WITH_PTRS(_Type)
|
|
43 |
|
|
44 |
_STLP_BEGIN_NAMESPACE
|
|
45 |
|
|
46 |
# if !defined ( _STLP_NO_BOOL )
|
|
47 |
_STLP_POINTERS_SPECIALIZE( bool )
|
|
48 |
# endif
|
|
49 |
_STLP_TYPE_TRAITS_POD_SPECIALIZE_V(void)
|
|
50 |
# ifndef _STLP_NO_SIGNED_BUILTINS
|
|
51 |
_STLP_POINTERS_SPECIALIZE( signed char )
|
|
52 |
# endif
|
|
53 |
_STLP_POINTERS_SPECIALIZE( char )
|
|
54 |
_STLP_POINTERS_SPECIALIZE( unsigned char )
|
|
55 |
_STLP_POINTERS_SPECIALIZE( short )
|
|
56 |
_STLP_POINTERS_SPECIALIZE( unsigned short )
|
|
57 |
_STLP_POINTERS_SPECIALIZE( int )
|
|
58 |
_STLP_POINTERS_SPECIALIZE( unsigned int )
|
|
59 |
_STLP_POINTERS_SPECIALIZE( long )
|
|
60 |
_STLP_POINTERS_SPECIALIZE( unsigned long )
|
|
61 |
_STLP_POINTERS_SPECIALIZE( float )
|
|
62 |
_STLP_POINTERS_SPECIALIZE( double )
|
|
63 |
# if !defined ( _STLP_NO_LONG_DOUBLE )
|
|
64 |
_STLP_POINTERS_SPECIALIZE( long double )
|
|
65 |
# endif
|
|
66 |
# if defined ( _STLP_LONG_LONG)
|
|
67 |
_STLP_POINTERS_SPECIALIZE( _STLP_LONG_LONG )
|
|
68 |
_STLP_POINTERS_SPECIALIZE( unsigned _STLP_LONG_LONG )
|
|
69 |
# endif
|
|
70 |
#if defined ( _STLP_HAS_WCHAR_T ) && ! defined (_STLP_WCHAR_T_IS_USHORT)
|
|
71 |
_STLP_POINTERS_SPECIALIZE( wchar_t )
|
|
72 |
# endif
|
|
73 |
|
|
74 |
_STLP_END_NAMESPACE
|
|
75 |
|
|
76 |
# undef _STLP_ARROW_SPECIALIZE
|
|
77 |
# undef _STLP_ARROW_SPECIALIZE_WITH_PTRS
|
|
78 |
# undef _STLP_TYPE_TRAITS_POD_SPECIALIZE_V
|
|
79 |
|
|
80 |
#endif
|