Boost logo

Boost :

From: Arash Partow (arash_at_[hidden])
Date: 2008-03-27 02:30:22


One other thing I forgot to mention, was when looking at the provided
link http://geometrylibrary.geodan.nl/points.html

The distance definition takes 2 templated point types but always
returns a double. The lesson here is that the precision required for
the the result may be more than the precision of the inputs. In this
case the best strategy is to at the minimum return the same numeric
type of the points as the result type or better.

The other issue is that the points should be of the same type, not
differing types. This strategy_traits approach where assuming there
will be an implementation for the combination of types is not
adequate, what if one of the types can be easily promoted to the
other?

eg: double conversion to my_super_duper_arbitrary_precision_floating_point_type
via copy constructor? does that mean I have to provide a wrapper around the
explicit call to my implementation of distance with my specific type?

Arash Partow
__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net


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