Boost logo

Boost :

Subject: Re: [boost] Unicode: what kind of binary compatibility do we want?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-06-03 09:08:31


Mathias Gaunard wrote
On Tuesday, June 02, 2009 12:22 PM
> Stewart, Robert wrote:
>
> > I don't know the implications of this, but I generally
> > dislike the idea of a silent fallback. I'd prefer to see two
> > interfaces: one throws an exception on out of range values
> > and one that accepts a default value to return in those cases.
>
> If the character has some new property value it means it had
> the default property value (which isn't really a property, it's
> more like a "other" or "any") in the previous versions, I'm
> fairly sure Unicode guarantees this.

It is important to be positive about this. If the default *is* appropriate for a new property value in all cases, then your approach is reasonable.

> > It might be useful to determine compatibility when the
> library starts, perhaps via an initialization call, and use
> the Strategy Pattern to determine the implementation. (When
> compatible, a property's accesses are unchecked. When
> incompatible, the property's accesses are checked.)
>
> That would mean virtual function call overhead, which should
> be higher than a simple branching in an inlined function.

Until you satisfy the requirements, performance isn't important. If your default handling approach is reasonable, then you must measure performance in real use cases. Until those points are addressed, you don't know the implications of using virtual calls. Don't dismiss them out of hand.

_____
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