Boost logo

Boost :

From: Michael Marcin (mmarcin_at_[hidden])
Date: 2007-06-29 15:39:23

John Maddock wrote:
> Michael Marcin wrote:
>> Hello,
>> I haven't looked much at the math toolkit yet but I was interested in
>> how it handled errors so I peeked at common_error_handling.hpp
>> I see it explicitly qualifies each all to isfinite with
>> (boost::math::isfinite)( value ).
>> I assume this is to prevent macro expansion however this means that
>> if a
>> UDT is passed in the user is required to add their isfinite to the
>> boost::math namespace instead of having it be reachable through ADL.
>> Is this intentional? I think the following would work if it's not.
>> using boost::math::isfinite;
>> I'm not sure if UDT support for this library has been considered in
>> its design but I'm working to provide a fixed-point math library that
>> I hope
>> can be used as a real type just like float and double. I would like
>> to
>> be able to keep as much as possible in the library's namespace.
> Good points, but if we rely on ADL don't we get ambiguities between
> boost::math::isfinite and ::isfinite (when defined as a global function)?

IIRC the using declaration brings boost::math::isfinite into local scope
and since the compiler finds a suitable function in this inner scope it
doesn't bother to search broader scopes (like global scope).

So I think this is OK.


Michael Marcin

Boost list run by bdawes at, gregod at, cpdaniel at, john at