Changeset 1664 for code/branches/gui/src/util
- Timestamp:
- Aug 21, 2008, 9:23:11 PM (16 years ago)
- Location:
- code/branches/gui/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/util/Convert.h
r1625 r1664 690 690 }; 691 691 692 693 /////////////////////////// 694 // Static type detection // 695 /////////////////////////// 696 697 /** 698 Template class that determines whether type T converts implicitly to type U. 699 @note 700 This allows to detect type conversion at compile time. 701 From 'Modern C++ Design' (Alexandrescu 2001). 702 */ 703 template <class T, class U> 704 class StaticConversion 705 { 706 class Small { char dummy[1]; }; 707 class Big { char dummy[1024]; }; 708 static Small Test(U); 709 static Big Test(...); 710 static T MakeT(); 711 public: 712 enum { exists = sizeof(Test(MakeT())) == sizeof(Small) }; 713 }; 714 692 715 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC 693 716 #pragma warning(pop) -
code/branches/gui/src/util/SubString.h
r1505 r1664 131 131 /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */ 132 132 inline const std::string& getString(unsigned int i) const { return (*this)[i]; }; 133 /** @brief Returns all Strings as std::vector */ 134 inline const std::vector<std::string>& getAllStrings() const { return this->strings; } 133 135 /** @brief Returns true if the token is in safemode. @param i the i'th token */ 134 136 inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
Note: See TracChangeset
for help on using the changeset viewer.