Add overloads for comparing safe<T> with T
This commit is contained in:
parent
5f43c06bae
commit
2593760687
1 changed files with 53 additions and 1 deletions
|
|
@ -150,27 +150,79 @@ namespace fc {
|
|||
{
|
||||
return a.value == b.value;
|
||||
}
|
||||
friend bool operator == ( const safe& a, const T& b )
|
||||
{
|
||||
return a.value == b;
|
||||
}
|
||||
friend bool operator == ( const T& a, const safe& b )
|
||||
{
|
||||
return a == b.value;
|
||||
}
|
||||
|
||||
friend bool operator < ( const safe& a, const safe& b )
|
||||
{
|
||||
return a.value < b.value;
|
||||
}
|
||||
friend bool operator < ( const safe& a, const T& b )
|
||||
{
|
||||
return a.value < b;
|
||||
}
|
||||
friend bool operator < ( const T& a, const safe& b )
|
||||
{
|
||||
return a < b.value;
|
||||
}
|
||||
|
||||
friend bool operator > ( const safe& a, const safe& b )
|
||||
{
|
||||
return a.value > b.value;
|
||||
}
|
||||
friend bool operator > ( const safe& a, const T& b )
|
||||
{
|
||||
return a.value > b;
|
||||
}
|
||||
friend bool operator > ( const T& a, const safe& b )
|
||||
{
|
||||
return a > b.value;
|
||||
}
|
||||
|
||||
friend bool operator != ( const safe& a, const safe& b )
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
friend bool operator != ( const safe& a, const T& b )
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
friend bool operator != ( const T& a, const safe& b )
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
friend bool operator <= ( const safe& a, const safe& b )
|
||||
{
|
||||
return !(a > b );
|
||||
return !(a > b);
|
||||
}
|
||||
friend bool operator <= ( const safe& a, const T& b )
|
||||
{
|
||||
return !(a > b);
|
||||
}
|
||||
friend bool operator <= ( const T& a, const safe& b )
|
||||
{
|
||||
return !(a > b);
|
||||
}
|
||||
|
||||
friend bool operator >= ( const safe& a, const safe& b )
|
||||
{
|
||||
return !(a < b);
|
||||
}
|
||||
friend bool operator >= ( const safe& a, const T& b )
|
||||
{
|
||||
return !(a < b);
|
||||
}
|
||||
friend bool operator >= ( const T& a, const safe& b )
|
||||
{
|
||||
return !(a < b);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue