-
-
Save ThePhD/d29878ca31474abc6f2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*template <typename T, ulword n, typename TArith> | |
type<std::enable_if<std::is_arithmetic<TArith>::value, RVector<T, n>>> | |
operator + ( TArith right, const RVector<T, n>& left ) { | |
RVector<T, n> r; | |
for ( ulword i = 0; i < n; ++i ) { | |
r[ i ] = static_cast<T>( left[ i ] + right ); | |
} | |
return r; | |
} | |
template <typename T, ulword n, typename TArith> | |
type<std::enable_if<std::is_arithmetic<TArith>::value, RVector<T, n>>> | |
operator + ( const RVector<T, n>& left, TArith right ) { | |
return right + left; | |
}*/ | |
template <typename T, ulword n> | |
RVector<T, n> operator + ( T right, const RVector<T, n>& left ) { | |
RVector<T, n> r; | |
for ( ulword i = 0; i < n; ++i ) { | |
r[ i ] = static_cast<T>( left[ i ] + right ); | |
} | |
return r; | |
} | |
template <typename T, ulword n> | |
RVector<T, n> operator + ( const RVector<T, n>& left, T right ) { | |
return right + left; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment