[DEV] add comparaison operator in vector

This commit is contained in:
Edouard DUPIN 2017-12-27 14:38:29 +01:00
parent 07eaa934a2
commit b1c561b0ab

View File

@ -95,6 +95,30 @@ namespace etk {
operator bool () {
return (m_current < m_vector->size());
}
/**
* @brief != Comparaison operator
* @param[in] _obj Object to compare
* @return true if the element are different
*/
bool operator!= (const Iterator& _obj) {
if ( m_vector != _obj.m_vector
|| m_current != _obj.m_current) {
return true;
}
return false;
}
/**
* @brief == Comparaison operator.
* @param[in] _obj Object to compare.
* @return true if the element are identical.
*/
bool operator== (const Iterator& _obj) {
if ( m_vector == _obj.m_vector
&& m_current == _obj.m_current) {
return true;
}
return false;
}
/**
* @brief Incremental operator
* @return Reference on the current iterator increment