00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00053 #ifndef STLSOFT_INCL_STLSOFT_META_HPP_IS_SAME_TYPE
00054 #define STLSOFT_INCL_STLSOFT_META_HPP_IS_SAME_TYPE
00055
00056 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00057 # define STLSOFT_VER_STLSOFT_META_HPP_IS_SAME_TYPE_MAJOR 4
00058 # define STLSOFT_VER_STLSOFT_META_HPP_IS_SAME_TYPE_MINOR 4
00059 # define STLSOFT_VER_STLSOFT_META_HPP_IS_SAME_TYPE_REVISION 2
00060 # define STLSOFT_VER_STLSOFT_META_HPP_IS_SAME_TYPE_EDIT 120
00061 #endif
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00079 # include <stlsoft/stlsoft.h>
00080 #endif
00081 #ifndef STLSOFT_INCL_STLSOFT_META_HPP_CAPABILITIES
00082 # include <stlsoft/meta/capabilities.hpp>
00083 #endif
00084
00085 #ifndef STLSOFT_INCL_STLSOFT_META_HPP_YESNO
00086 # include <stlsoft/meta/yesno.hpp>
00087 #endif
00088
00089 #if defined(STLSOFT_COMPILER_IS_MSVC) && \
00090 _MSC_VER < 1200
00091 # error This file is not compatible with Visual C++ 5.0 or earlier
00092 #endif
00093
00094
00095
00096
00097
00098 #ifndef _STLSOFT_NO_NAMESPACE
00099 namespace stlsoft
00100 {
00101 #endif
00102
00103
00104
00105
00106
00107 #if defined(STLSOFT_COMPILER_IS_BORLAND)
00108
00109 struct is_same_type_helper
00110 {
00111 template <ss_typename_param_k A>
00112 static yes_type is_same_type_function(A const&, A const&);
00113
00114 template< ss_typename_param_k A
00115 , ss_typename_param_k B
00116 >
00117 static no_type is_same_type_function(A const&, B const&);
00118 };
00119
00120 template< ss_typename_param_k A
00121 , ss_typename_param_k B
00122 >
00123 struct is_same_type
00124 {
00125 enum { value = (sizeof(yes_type) == sizeof(is_same_type_helper::is_same_type_function(A(), B()))) };
00126 };
00127
00128 template <ss_typename_param_k A>
00129 struct is_same_type<void, A>
00130 {
00131 enum { value = 0 };
00132
00133 typedef no_type type;
00134 };
00135
00136 template <ss_typename_param_k A>
00137 struct is_same_type<A, void>
00138 {
00139 enum { value = 0 };
00140
00141 typedef no_type type;
00142 };
00143
00144 STLSOFT_TEMPLATE_SPECIALISATION
00145 struct is_same_type<void, void>
00146 {
00147 enum { value = 1 };
00148
00149 typedef yes_type type;
00150 };
00151
00152 #elif defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT)
00153
00159 template< ss_typename_param_k T1
00160 , ss_typename_param_k T2
00161 >
00162 struct is_same_type
00163 {
00164 enum { value = 0 };
00165
00166 typedef no_type type;
00167 };
00168
00169 # ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00170
00171 template <ss_typename_param_k T>
00172 struct is_same_type<T, T>
00173 {
00174 enum { value = 1 };
00175
00176 typedef yes_type type;
00177 };
00178
00179 # endif
00180
00181 #else
00182
00183 template< ss_typename_param_k T1
00184 , ss_typename_param_k T2
00185 >
00186 struct is_same_type
00187 {
00188 private:
00189 template <ss_typename_param_k >
00190 struct same_
00191 {
00192 enum { value = 0 };
00193
00194 typedef no_type type;
00195 };
00196 STLSOFT_TEMPLATE_SPECIALISATION
00197 struct same_<T1>
00198 {
00199 enum { value = 1 };
00200
00201 typedef yes_type type;
00202 };
00203
00204 public:
00205 enum { value = same_<T2>::value };
00206
00207 typedef ss_typename_type_k same_<T2>::type type;
00208 };
00209
00210 #endif
00211
00212
00213
00214
00215
00216 #ifdef STLSOFT_UNITTEST
00217 # include "./unittest/is_same_type_unittest_.h"
00218 #endif
00219
00220
00221
00222 #ifndef _STLSOFT_NO_NAMESPACE
00223 }
00224 #endif
00225
00226
00227
00228 #endif
00229
00230