Re: [Boost-users] [STL] Is there a std::abs<>() function? (Max)

Hello Scott I'm not sure what you mean by ADL? Thanks for reply. Best regards Max ----- Original Message ----- From: Scott McMurray To: boost-users@lists.boost.org Subject: Re: [Boost-users] [STL] Is there a std::abs<>() function? (Max) Date: 2008-12-23 12:42:48 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 and ). ~ Scott ------------------------------------------------------------------- 新浪空间——与朋友开心分享网络新生活!(http://space.sina.com.cn/ )

On Tue, Dec 23, 2008 at 09:11, Max
I'm not sure what you mean by ADL?
http://en.wikipedia.org/wiki/Argument_dependent_name_lookup In short, I'm suggesting using name lookup and overload resolution to find the correct abs function for the type, rather than using a template to generate one.
participants (2)
-
Max
-
Scott McMurray