[DEV] add comparaison operator in vector
This commit is contained in:
parent
07eaa934a2
commit
b1c561b0ab
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user