Boost logo

Geometry :

Subject: [ggl] Surprising ADL
From: Barend Gehrels (barend.gehrels)
Date: 2010-07-09 03:56:18


Bruno Lalande wrote:
> Hi ZhouShuangJiang,
>
>
>> Talking of ADL, I also found some part of the lib use qualified call to
>> stdlib functions, which will forbid the use of ADL.
>> For example, in
>> boost::geometry::detail::overlay::enrich_containment::enrich(), the
>> qualified std::abs() will forbid the user from using his own abs() for UDT.
>>
>
> Good catch, we indeed have to remove all those qualified calls to enable ADL.
>

Done.

The std::abs() required a trick, because without it is considered as C
abs (taking an integer). I consulted #boost at IRC on it and they
proposed the solution which is now there. The library calls
geometry::math::abs() internally. That function calls "using std::abs"
to get the right abs, and at the same time enable ADL.

Regards, Barend

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20100709/94a661ab/attachment.html


Geometry list run by mateusz at loskot.net