Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-03-24 05:31:37

Hugh Wimberly wrote:
> I could be way off base here, but I assumed the question related to
> the use
> of try/catch blocks, which are very expensive compared to unmanaged
> code.
> The divide by zero question is easy to answer, because unless one of
> the values is volatile, then it's more efficient to check the
> denominator before the division than put the division in a try/catch
> block. I suppose other examples are more complicated, but as far as I
> know for a library like this essentially nothing should use try/catch
> blocks, even if some code should have the capability to throw errors
> (which is a different matter entirely)

Right, but the library doesn't need any try...catch blocks, the user would
insert those probably around the whole calculation: the overhead would be
unnoticable compared to even a single BigInt divide I suspect.


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