Changeset 1768 for code/branches/core3/src/util/Convert.h
- Timestamp:
- Sep 11, 2008, 4:40:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/util/Convert.h
r1766 r1768 50 50 #endif 51 51 52 ///////////////////////////////////53 // Explicit Conversion Functions //54 ///////////////////////////////////55 56 57 52 /////////////////////////////////////////////// 58 53 // Static detection for conversion functions // … … 96 91 return *(new conversionTests::VeryBigStruct()); 97 92 } 98 }99 100 namespace conversionTests101 {102 // Part of the msvc hack. See above in the namespace for more explanations.103 using namespace separate_namespace;104 93 105 94 // These operators simply accept anything but have lower priority than specialisations … … 111 100 template <class Any> 112 101 conversionTests::VeryBigStruct operator>>(std::istream& instream, const Any anything); 102 } 103 104 namespace conversionTests 105 { 106 // Part of the msvc hack. See above in the namespace for more explanations. 107 using namespace separate_namespace; 113 108 114 109 template <class FromType, class ToType> … … 144 139 { 145 140 IStringStreamOperator(); IStringStreamOperator(const IStringStreamOperator&); ~IStringStreamOperator(); 146 static std::istr ingstream istream_; // helper object to perform the '>>' operation141 static std::istream istream_; // helper object to perform the '>>' operation 147 142 static Type object; // helper object to handle private c'tor and d'tor 148 143 public: … … 154 149 { 155 150 OStringStreamOperator(); OStringStreamOperator(const OStringStreamOperator&); ~OStringStreamOperator(); 156 static std::ostr ingstream ostream_; // helper object to perform the '<<' operation151 static std::ostream ostream_; // helper object to perform the '<<' operation 157 152 static Type object; // helper object to handle private c'tor and d'tor 158 153 public: … … 169 164 Usage: ImplicitConversion<FromType, ToType>::exists 170 165 */ 171 template <class FromType, class ToType>172 struct ImplicitConversion173 { enum { exists = conversionTests::ImplicitConversion<FromType, ToType>::exists }; };166 //template <class FromType, class ToType> 167 //struct ImplicitConversion 168 //{ enum { exists = conversionTests::asdf::ImplicitConversion<FromType, ToType>::exists }; }; 174 169 175 170 /** … … 179 174 Usage: ExplicitConversion<FromType, ToType>::exists 180 175 */ 181 template <class FromType, class ToType>182 struct ExplicitConversion183 { enum { exists = conversionTests::ExplicitConversion<FromType, ToType>::exists }; };176 //template <class FromType, class ToType> 177 //struct ExplicitConversion 178 //{ enum { exists = conversionTests::asdf::ExplicitConversion<FromType, ToType>::exists }; }; 184 179 185 180 /** … … 189 184 Usage: IStringStreamConversion<FromType, ToType>::exists 190 185 */ 191 template <class Type>192 struct IStringStreamOperator193 { enum { exists = conversionTests::IStringStreamOperator<Type>::exists }; };186 //template <class Type> 187 //struct IStringStreamOperator 188 //{ enum { exists = conversionTests::asdf::IStringStreamOperator<Type>::exists }; }; 194 189 195 190 /** … … 199 194 Usage: OStringStreamConversion<FromType, ToType>::exists 200 195 */ 201 template <class Type>202 struct OStringStreamOperator203 { enum { exists = conversionTests::OStringStreamOperator<Type>::exists }; };196 //template <class Type> 197 //struct OStringStreamOperator 198 //{ enum { exists = conversionTests::asdf::OStringStreamOperator<Type>::exists }; }; 204 199 205 200 … … 286 281 static bool convert(std::string* output, const FromType& input) 287 282 { 288 const bool probe = OStringStreamOperator<FromType>::exists;283 const bool probe = conversionTests::OStringStreamOperator<FromType>::exists; 289 284 return convert(output, input, StringStreamPossible<probe>()); 290 285 } … … 328 323 static bool convert(ToType* output, const std::string& input) 329 324 { 330 const bool probe = IStringStreamOperator<ToType>::exists;325 const bool probe = conversionTests::IStringStreamOperator<ToType>::exists; 331 326 return convert(output, input, StringStreamPossible<probe>()); 332 327 } … … 381 376 inline bool convert(ToType* output, const FromType& input, ExplicitPossible<false>) 382 377 { 383 const bool probe = ImplicitConversion<FromType, ToType>::exists;378 const bool probe = conversionTests::ImplicitConversion<FromType, ToType>::exists; 384 379 return convert(output, input, ImplicitPossible<probe>()); 385 380 } … … 398 393 { 399 394 // check for explicit conversion via function overloading 400 const bool probe = ExplicitConversion<FromType, ToType>::exists;395 const bool probe = conversionTests::ExplicitConversion<FromType, ToType>::exists; 401 396 return conversion::convert(output, input, conversion::ExplicitPossible<probe>()); 402 397 }
Note: See TracChangeset
for help on using the changeset viewer.