operator!= for nested types

This commit is contained in:
2021-06-24 17:08:55 +02:00
parent cc65575536
commit 9ce8e74e19
2 changed files with 15 additions and 1 deletions

11
vec.h
View File

@@ -170,7 +170,16 @@ public:
NRVec& operator|=(const NRVec &rhs);
//! relational operators
const bool operator!=(const NRVec &rhs) const {if(nn!=rhs.nn) return 1; return LA_traits<T>::gencmp(v,rhs.v,nn);}
const bool operator!=(const NRVec &rhs) const
{
if(nn!=rhs.nn) return 1;
if(LA_traits<T>::is_plaindata()) return LA_traits<T>::gencmp(v,rhs.v,nn);
else
{
for(int i=0; i<nn; ++i) if(v[i]!=rhs.v[i]) return 1;
return 0;
}
}
const bool operator==(const NRVec &rhs) const {return !(*this != rhs);};
const bool operator>(const NRVec &rhs) const;
const bool operator<(const NRVec &rhs) const;