Boost logo

Boost :

Subject: Re: [boost] Geometry and spatial indexes, my opinion
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-10-09 12:19:43


Brandon Kohn wrote:
> //! Function to find the cross product between two vectors formed by the
> specified three points which share an endpoint at A.
> template <typename Point>
> point_traits<Point>::coordinate_type cross_product( const Point& A,
>
> const Point& B,
>
> const Point& C )

Isn't the result of the cross product a vector/point?

> {
> typedef cartesian_access_traits<Point > access_traits;
> boost::function_requires<Point2DConcept<Point> >();

Isn't the cross product 3D-only?
Anyway, wouldn't it be better to use SFINAE so that you can overload the
algorithm to make it work with other concepts?

> When I was talking about access like tuple, I meant using compile time
> indexing via the access traits. One of the main goals of my library is
> to facilitate use with legacy geometry code (proprietary in my case)
> simply by specializing access traits. Using access traits results in
> little constraint on the interface of the underlying point type.

Are you aware of the Fusion sequence concepts?
Any type can be made into a fusion sequence non-intrusively.

So there is no need to recreate the get<N> machinery.


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