Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-03-30 07:15:16


Chad Nelson wrote:
> On 03/29/2010 05:26 AM, Paul A. Bristow wrote:
>
> > While there are things that are mathematically right or wrong, the
> > application or user may not consider this important.
>
> I'm trying to set up the library so that, if the user knows what to
> expect mathematically, he isn't surprised at any XInt behavior.

Doing so can make the library less approachable to those without the mathematical expectations. Be careful about purity in this sense.

> > Policies allow the user to get exceptions thrown when something
> > 'nasty' happens (like divide by minus zero say), or not.
> >
> > Existing code may rely on getting a NaN, or may rely on
> > *not* getting a NaN. Policies allow users to decide.
>
> Exactly what I was intending with the exception-blocking mechanism.

Your approach involves runtime cost, I think. Policies allow altering the implementation, at compile time.

How does one mix code wanting exceptions with code not wanting them? With policies, the two types differ, but can be designed for interoperability.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk