equal
deleted
inserted
replaced
147 if (++m_val >= end) m_val -= (storage_type)(end - begin); |
147 if (++m_val >= end) m_val -= (storage_type)(end - begin); |
148 return *this; |
148 return *this; |
149 } |
149 } |
150 }; |
150 }; |
151 |
151 |
152 template <typename T> void ToggleBitT(T &t, int bit_index) |
|
153 { |
|
154 t = (T)(t ^ ((T)1 << bit_index)); |
|
155 } |
|
156 |
|
157 /** |
152 /** |
158 * Overflow safe template for integers, i.e. integers that will never overflow |
153 * Overflow safe template for integers, i.e. integers that will never overflow |
159 * you multiply the maximum value with 2, or add 2, or substract somethng from |
154 * you multiply the maximum value with 2, or add 2, or substract somethng from |
160 * the minimum value, etc. |
155 * the minimum value, etc. |
161 * @param T the type these integers are stored with. |
156 * @param T the type these integers are stored with. |