Commit 007af576 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

PsimagLite::IsNumber added

parent fe9f7ee7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ Please see full open source license included in file LICENSE.
#define PSICOMPLEX_H_

#include <complex>
#include "loki/TypeTraits.h"

namespace std {

inline double real(double t) { return t; }
@@ -64,6 +66,11 @@ class IsComplexNumber<std::complex<T> > {
public:
	enum { True = true};
};

template<typename T>
struct IsNumber {
	enum {True = (IsComplexNumber<T>::True || Loki::TypeTraits<T>::isArith)};
};
} // namespace PsimagLite

#endif // PSICOMPLEX_H_
+2 −1
Original line number Diff line number Diff line
@@ -149,7 +149,8 @@ operator<=(vector<T2,A>& v,
}

template<typename T1,typename T2,typename A>
void operator<=(vector<T2,A>& v,
typename PsimagLite::EnableIf<PsimagLite::IsNumber<T1>::True && PsimagLite::IsNumber<T2>::True,
void>::Type operator<=(vector<T2,A>& v,
                const ClosureOperator<T1,
                ClosureOperator<T2,std::vector<T2,A>,ClosureOperations::OP_MULT>,
                ClosureOperations::OP_MULT>& c)