Changeset 417
- Timestamp:
- 11/02/11 08:25:12 (7 months ago)
- Location:
- cafu/trunk
- Files:
-
- 2 modified
-
CaWE/GuiEditor/Commands/SetWinProp.cpp (modified) (1 diff)
-
Libs/Templates/Array.hpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cafu/trunk/CaWE/GuiEditor/Commands/SetWinProp.cpp
r415 r417 46 46 47 47 // If the new value isn't different from the old, don't put this command into the command history. 48 //if (m_NewValue==m_OldValue) return false;48 if (m_NewValue==m_OldValue) return false; 49 49 50 50 m_Value=m_NewValue; -
cafu/trunk/Libs/Templates/Array.hpp
r285 r417 20 20 */ 21 21 22 /*********************/ 23 /*** Array Library ***/ 24 /*********************/ 25 26 #ifndef _CA_ARRAY_HPP_ 27 #define _CA_ARRAY_HPP_ 22 #ifndef _CF_ARRAY_HPP_ 23 #define _CF_ARRAY_HPP_ 28 24 29 25 #include <stdlib.h> 30 26 #include <cassert> 31 32 #if defined(_WIN32) && defined(_MSC_VER)33 #if (_MSC_VER<1300)34 #define for if (false) ; else for35 36 // Turn off warning 4786: "Bezeichner wurde auf '255' Zeichen in den Debug-Informationen reduziert."37 #pragma warning(disable:4786)38 #endif39 #endif40 27 41 28 … … 62 49 ~ArrayT(); ///< Destructor 63 50 ArrayT<T>& operator = (const ArrayT<T>& OldArray); ///< Assignment operator 51 bool operator == (const ArrayT<T>& Other) const; ///< Equality operator 52 bool operator != (const ArrayT<T>& Other) const; ///< Inequality operator 64 53 65 54 unsigned long Size() const; ///< Get size of array … … 78 67 void RemoveAt(unsigned long Index); 79 68 void RemoveAtAndKeepOrder(unsigned long Index); 80 void QuickSort(bool (*IsLess)(const T& E1, const T& E2)); 69 template<typename Function> 70 void QuickSort(Function IsLess); 81 71 // void QuickSort(unsigned long FirstIndex, unsigned long LastIndex, bool (*IsLess)(const T& E1, const T& E2)); 82 72 int Find(const T& Element) const; … … 120 110 Elements =NewElements; 121 111 return *this; 112 } 113 114 115 template<class T> inline bool ArrayT<T>::operator == (const ArrayT<T>& Other) const 116 { 117 if (NrOfElements != Other.NrOfElements) 118 return false; 119 120 for (unsigned long Nr=0; Nr<NrOfElements; Nr++) 121 if (Elements[Nr] != Other.Elements[Nr]) 122 return false; 123 124 return true; 125 } 126 127 128 template<class T> inline bool ArrayT<T>::operator != (const ArrayT<T>& Other) const 129 { 130 return !(this->operator == (Other)); 122 131 } 123 132 … … 279 288 280 289 281 template<class T> inline void ArrayT<T>::QuickSort(bool (*IsLess)(const T& E1, const T& E2))290 template<class T> template<typename Function> inline void ArrayT<T>::QuickSort(Function IsLess) 282 291 { 283 292 static ArrayT<unsigned long> ToDoRanges;
