Fix a mixup with template parameters.

This commit is contained in:
King_DuckZ 2014-07-28 11:01:25 +02:00
parent 54e8a27709
commit cdaffe0f2b
2 changed files with 8 additions and 8 deletions

View file

@ -81,13 +81,13 @@ namespace cloonel {
template <typename T, typename U, uint32_t S>
Vector<typename std::common_type<T, U>::type, S> operator/ ( Vector<T, S> parA, const Vector<U, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator+ ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
Vector<typename std::common_type<T, U>::type, S> operator+ ( U parA, const Vector<T, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator- ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
Vector<typename std::common_type<T, U>::type, S> operator- ( U parA, const Vector<T, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator* ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
Vector<typename std::common_type<T, U>::type, S> operator* ( U parA, const Vector<T, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator/ ( U parA, const Vector<U, S>& parB ) __attribute__((pure));
Vector<typename std::common_type<T, U>::type, S> operator/ ( U parA, const Vector<T, S>& parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>
Vector<typename std::common_type<T, U>::type, S> operator+ ( const Vector<T, S>& parA, U parB ) __attribute__((pure));
template <typename T, typename U, uint32_t S, typename=typename std::enable_if<std::is_fundamental<U>::value>::type>

View file

@ -139,19 +139,19 @@ namespace cloonel {
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator+ (T parA, const Vector<U, S>& parB) {
Vector<typename std::common_type<T, U>::type, S> operator+ (U parA, const Vector<T, S>& parB) {
return parB + parA;
}
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator- (T parA, const Vector<U, S>& parB) {
Vector<typename std::common_type<T, U>::type, S> operator- (U parA, const Vector<T, S>& parB) {
return Vector<T, S>(parA) - parB;
}
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator* (T parA, const Vector<U, S>& parB) {
Vector<typename std::common_type<T, U>::type, S> operator* (U parA, const Vector<T, S>& parB) {
return parB * parA;
}
template <typename T, typename U, uint32_t S, typename>
Vector<typename std::common_type<T, U>::type, S> operator/ (T parA, const Vector<U, S>& parB) {
Vector<typename std::common_type<T, U>::type, S> operator/ (U parA, const Vector<T, S>& parB) {
return Vector<T, S>(parA) / parB;
}
template <typename T, typename U, uint32_t S, typename>