Changeset 2154:bbc79b698f62 in lemon0.x
 Timestamp:
 07/18/06 18:59:34 (13 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2868
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/tolerance.h
r2073 r2154 50 50 ///\sa Tolerance<int> 51 51 ///\sa Tolerance<long long int> 52 ///\sa Tolerance<unsigned int> 53 ///\sa Tolerance<unsigned long long int> 52 54 53 55 template<class T> … … 272 274 }; 273 275 276 ///Unsigned integer specialization of \ref Tolerance. 277 278 ///Unsigned integer specialization of \ref Tolerance. 279 ///\sa Tolerance 280 template<> 281 class Tolerance<unsigned int> 282 { 283 public: 284 ///\e 285 typedef unsigned int Value; 286 287 ///\name Comparisons 288 ///See \ref Tolerance for more details. 289 290 ///@{ 291 292 ///Returns \c true if \c a is \e surely strictly less than \c b 293 static bool less(Value a,Value b) { return a<b;} 294 ///Returns \c true if \c a is \e surely different from \c b 295 static bool different(Value a,Value b) { return a!=b; } 296 ///Returns \c true if \c a is \e surely positive 297 static bool positive(Value a) { return 0<a; } 298 ///Returns \c true if \c a is \e surely negative 299 static bool negative(Value) { return false; } 300 ///Returns \c true if \c a is \e surely nonzero 301 static bool nonZero(Value a) { return a!=0; }; 302 303 ///@} 304 305 ///Returns zero 306 static Value zero() {return 0;} 307 }; 308 274 309 #ifndef __STRICT_ANSI__ 275 310 … … 277 312 278 313 ///Long long integer specialization of \ref Tolerance. 279 ///\warning This class is not ansi compatible. 314 ///\warning This class (more exactly, type <tt>long long</tt>) 315 ///is not ansi compatible. 280 316 ///\sa Tolerance 281 317 template<> … … 308 344 }; 309 345 346 ///Unsigned long long integer specialization of \ref Tolerance. 347 348 ///Unsigned long long integer specialization of \ref Tolerance. 349 ///\warning This class (more exactly, type <tt>unsigned long long</tt>) 350 ///is not ansi compatible. 351 ///\sa Tolerance 352 template<> 353 class Tolerance<unsigned long long int> 354 { 355 public: 356 ///\e 357 typedef unsigned long long int Value; 358 359 ///\name Comparisons 360 ///See \ref Tolerance for more details. 361 362 ///@{ 363 364 ///Returns \c true if \c a is \e surely strictly less than \c b 365 static bool less(Value a,Value b) { return a<b;} 366 ///Returns \c true if \c a is \e surely different from \c b 367 static bool different(Value a,Value b) { return a!=b; } 368 ///Returns \c true if \c a is \e surely positive 369 static bool positive(Value a) { return 0<a; } 370 ///Returns \c true if \c a is \e surely negative 371 static bool negative(Value) { return false; } 372 ///Returns \c true if \c a is \e surely nonzero 373 static bool nonZero(Value a) { return a!=0;}; 374 375 ///@} 376 377 ///Returns zero 378 static Value zero() {return 0;} 379 }; 380 310 381 #endif 311 382
Note: See TracChangeset
for help on using the changeset viewer.