This commit is contained in:
Tiago Gomes
2013-02-08 00:56:42 +00:00
parent c41b6d80b6
commit 98842dca74
3 changed files with 17 additions and 34 deletions

View File

@@ -402,35 +402,26 @@ operator<< (std::ostream& os, const std::vector<T>& v)
namespace func_obj {
template<typename T>
struct max : public std::binary_function<T, T, T>
{
T operator() (const T& x, const T& y) const
{
struct max : public std::binary_function<T, T, T> {
T operator() (const T& x, const T& y) const {
return x < y ? y : x;
}
};
}};
template <typename T>
struct abs_diff : public std::binary_function<T, T, T>
{
T operator() (const T& x, const T& y) const
{
struct abs_diff : public std::binary_function<T, T, T> {
T operator() (const T& x, const T& y) const {
return std::abs (x - y);
}
};
}};
template <typename T>
struct abs_diff_exp : public std::binary_function<T, T, T>
{
T operator() (const T& x, const T& y) const
{
struct abs_diff_exp : public std::binary_function<T, T, T> {
T operator() (const T& x, const T& y) const {
return std::abs (std::exp (x) - std::exp (y));
}
};
}};
} // namespace func_obj