Re: [Boost-users] [STL] Is there a std::abs<>() function? (Max)
hello Philip, Thanks for your reply. What I need is a template version of abs, not the int abs(int) function, to make use of it genericly. B/Rgds Max ----- Original Message ----- From: Philip Ogunbona To: boost-users@lists.boost.org Subject: [Boost-users] [STL] Is there a std::abs<>() function? (Max) Date: 2008-12-22 23:45:52 Max, Using STL does not prevent access to abs(), fabs() and labs(). You just need to #include . Is that what you want? Philip ------------------------------------------------------------------- 新浪空间——与朋友开心分享网络新生活!(http://space.sina.com.cn/ )
On Mon, Dec 22, 2008 at 21:06, Max
What I need is a template version of abs, not the int abs(int) function, to make use of it genericly.
Do you really need a template of it? I can't see why using ADL wouldn't be enough (with a using declaration for std::abs, to catch the overloads for scalars from <cstdlib> and <cmath>). ~ Scott
Scott McMurray wrote:
On Mon, Dec 22, 2008 at 21:06, Max
wrote: What I need is a template version of abs, not the int abs(int) function, to make use of it genericly.
Do you really need a template of it? I can't see why using ADL wouldn't be enough (with a using declaration for std::abs, to catch the overloads for scalars from <cstdlib> and <cmath>).
I certainly use template versions of Max, Min, and AbsoluteValue, because I need them for user-defined classes (that represent real numbers) and not just for built-in types.
participants (3)
-
Deane Yang
-
Max
-
Scott McMurray