/home/ntakagi/work/STLport-5.1.5/stlport/stl/_ptrs_specialize.hGo to the documentation of this file.00001 #ifndef _STLP_PTRS_SPECIALIZE_H 00002 #define _STLP_PTRS_SPECIALIZE_H 00003 00004 #ifndef _STLP_TYPE_TRAITS_H 00005 # include <stl/type_traits.h> 00006 #endif 00007 00008 // the following is a workaround for arrow operator problems 00009 #if defined ( _STLP_NO_ARROW_OPERATOR ) 00010 // User wants to disable proxy -> operators 00011 # define _STLP_DEFINE_ARROW_OPERATOR 00012 # define _STLP_ARROW_SPECIALIZE_WITH_PTRS(_Tp) 00013 #else 00014 // Compiler can handle generic -> operator. 00015 # define _STLP_ARROW_SPECIALIZE_WITH_PTRS(_Tp) 00016 # if defined (__BORLANDC__) 00017 # define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { return &(*(*this)); } 00018 # elif defined(__WATCOMC__) 00019 # define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { reference x = operator*(); return &x; } 00020 # else 00021 # define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { return &(operator*()); } 00022 # endif 00023 #endif /* _STLP_NO_ARROW_OPERATOR */ 00024 00025 // Important pointers specializations 00026 00027 #ifdef _STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS 00028 # define _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(_Type) 00029 # define _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type) 00030 #else 00031 # define _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type) _STLP_TEMPLATE_NULL struct __type_traits<_Type> : __type_traits_aux<1> {}; 00032 # define _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(_Type) \ 00033 _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type*) \ 00034 _STLP_TYPE_TRAITS_POD_SPECIALIZE(const _Type*) \ 00035 _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type**) \ 00036 _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type* const *) \ 00037 _STLP_TYPE_TRAITS_POD_SPECIALIZE(const _Type**) \ 00038 _STLP_TYPE_TRAITS_POD_SPECIALIZE(_Type***) \ 00039 _STLP_TYPE_TRAITS_POD_SPECIALIZE(const _Type***) 00040 #endif 00041 00042 # define _STLP_POINTERS_SPECIALIZE(_Type) _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(_Type) _STLP_ARROW_SPECIALIZE_WITH_PTRS(_Type) 00043 00044 _STLP_BEGIN_NAMESPACE 00045 00046 # if !defined ( _STLP_NO_BOOL ) 00047 _STLP_POINTERS_SPECIALIZE( bool ) 00048 # endif 00049 _STLP_TYPE_TRAITS_POD_SPECIALIZE_V(void) 00050 # ifndef _STLP_NO_SIGNED_BUILTINS 00051 _STLP_POINTERS_SPECIALIZE( signed char ) 00052 # endif 00053 _STLP_POINTERS_SPECIALIZE( char ) 00054 _STLP_POINTERS_SPECIALIZE( unsigned char ) 00055 _STLP_POINTERS_SPECIALIZE( short ) 00056 _STLP_POINTERS_SPECIALIZE( unsigned short ) 00057 _STLP_POINTERS_SPECIALIZE( int ) 00058 _STLP_POINTERS_SPECIALIZE( unsigned int ) 00059 _STLP_POINTERS_SPECIALIZE( long ) 00060 _STLP_POINTERS_SPECIALIZE( unsigned long ) 00061 _STLP_POINTERS_SPECIALIZE( float ) 00062 _STLP_POINTERS_SPECIALIZE( double ) 00063 # if !defined ( _STLP_NO_LONG_DOUBLE ) 00064 _STLP_POINTERS_SPECIALIZE( long double ) 00065 # endif 00066 # if defined ( _STLP_LONG_LONG) 00067 _STLP_POINTERS_SPECIALIZE( _STLP_LONG_LONG ) 00068 _STLP_POINTERS_SPECIALIZE( unsigned _STLP_LONG_LONG ) 00069 # endif 00070 #if defined ( _STLP_HAS_WCHAR_T ) && ! defined (_STLP_WCHAR_T_IS_USHORT) 00071 _STLP_POINTERS_SPECIALIZE( wchar_t ) 00072 # endif 00073 00074 _STLP_END_NAMESPACE 00075 00076 # undef _STLP_ARROW_SPECIALIZE 00077 # undef _STLP_ARROW_SPECIALIZE_WITH_PTRS 00078 # undef _STLP_TYPE_TRAITS_POD_SPECIALIZE_V 00079 00080 #endif
Generated on Mon Mar 10 15:32:32 2008 by ![]() |