Simplify the use of custom scalar types, the rule is to never directly call a standard math function using std:: but rather put a using std::foo before and simply call foo:

using std::max;
max(a,b);
This commit is contained in:
Gael Guennebaud
2011-05-25 08:41:45 +02:00
parent 5541bcb769
commit 87ac09daa8
10 changed files with 73 additions and 40 deletions

View File

@@ -134,12 +134,12 @@ pdiv(const Packet& a,
/** \internal \returns the min of \a a and \a b (coeff-wise) */
template<typename Packet> inline Packet
pmin(const Packet& a,
const Packet& b) { return std::min(a, b); }
const Packet& b) { using std::min; return min(a, b); }
/** \internal \returns the max of \a a and \a b (coeff-wise) */
template<typename Packet> inline Packet
pmax(const Packet& a,
const Packet& b) { return std::max(a, b); }
const Packet& b) { using std::max; return max(a, b); }
/** \internal \returns the absolute value of \a a */
template<typename Packet> inline Packet