Boost logo

Boost Users :

Subject: Re: [Boost-users] [units] subtract_typeof_helper<> help!
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-05-18 10:15:24


AMDG

Terry Golubiewski wrote:
> I'm trying to use boost::geometry and boost::units together.
> For some reason boost::geometry doesn't represent the difference of
> two points as vectors.
> So, I'm making my own Vector class and defining Vector = Point - Point.
> The sample program below doesn't compile because I need to tell the
> units library about the special properties of point subtraction (I think).

The problem is that your operator- can't be found by ADL.

> using namespace boost::geometry;
>
> typedef point<double, 3, cs::cartesian> Point;
> <snip>
>
> inline
> Vector operator-(const Point& lhs, const Point& rhs);

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net