[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [vsipl++] [patch] RFA mercury's missing std::abs
- To: VSIPL++ Developers List <vsipl++@xxxxxxxxxxxxxxxx>
- Subject: Re: [vsipl++] [patch] RFA mercury's missing std::abs
- From: Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
- Date: Fri, 11 Nov 2005 09:07:29 -0500
Jules Bergmann wrote:
This patch checks for missing std::abs overloads for float and double at
configure time. If missing (and ::abs overloads exist),
VSIP_IMPL_FIX_MISSING_ABS is defined, which causes vsip::mag and
vsip::magsq to use a blend of vsip::abs and ::abs.
This should be more robust than relying on the order of <cmath> and
<cstdlib> (which might break if users include standard headers before
including vsip headers -- something I tend to do).
Comments?
Since we now understand exactly what is going wrong (i.e. the
namespace std { using ::abs;}
line is issued before the relevant declarations have been seen),
why don't we simply place such a using-directive close to our own
inclusion of <cmath> ? That would have the exact same effect as
including <cstdlib> after <cmath>, without relying on its header guards
not being active.
Regards,
Stefan
|