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