Support for unary minus operator.
This commit is contained in:
parent
4cabdef306
commit
108c10883a
2 changed files with 11 additions and 0 deletions
|
@ -105,6 +105,9 @@ namespace cloonel {
|
|||
template <typename T, typename U, uint32_t S>
|
||||
bool operator!= ( const Vector<T, S>& parA, const Vector<U, S>& parB ) __attribute__((pure));
|
||||
|
||||
template <typename T, uint32_t S>
|
||||
Vector<T, S> operator- ( Vector<T, S> parOperand ) __attribute__((pure));
|
||||
|
||||
typedef Vector<float, 2> float2;
|
||||
typedef Vector<uint16_t, 2> ushort2;
|
||||
typedef Vector<int32_t, 2> int2;
|
||||
|
|
|
@ -245,4 +245,12 @@ namespace cloonel {
|
|||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
template <typename T, uint32_t S>
|
||||
Vector<T, S> operator- (Vector<T, S> parOperand) {
|
||||
for (uint32_t z = 0; z < S; ++z) {
|
||||
parOperand[z] = -parOperand[z];
|
||||
}
|
||||
return parOperand;
|
||||
}
|
||||
} //namespace cloonel
|
||||
|
|
Loading…
Reference in a new issue