Peter,
I just committed the more portable fix we discussed, below. -Fred
float vgui_soview2D_lineseg::distance_squared(float x, float y) const
{
// Here we explicitely cast some parameters to type float to help
// the Borland compiler, which otherwise tries to use
// vgl_distance2_to_linesegment<const float>, presumably because
// this is a const member function so some of the parameters passed
// to vgl_distance2_to_linesegment are effectively of type const
// float.
return vgl_distance2_to_linesegment(float(x0), float(y0), float(x1),
float(y1), x, y);
}
> -----Original Message-----
> From: Peter Vanroose [mailto:Peter.Vanroose@...]
> Sent: Monday, November 24, 2003 4:59 PM
> To: fred_wheeler@...
> Cc: brad.king@...; vxl-maintainers@...
> Subject: RE: Borland vgl/vgui problem
>
>
> > return vgl_distance2_to_linesegment<float>(x0, y0, x1, y1, x, y);
>
> I'm afraid this won't work with e.g. SGI's native compiler.
> It does not allow functions to be "qualified" with <some_class>.
> I don't know what the C++ standard has to say about this.
>
> Here is the error message:
>
> "vgui_soview2D.cxx", line 115: error(1227): type name is not allowed
> return vgl_distance2_to_linesegment<float>(x0, y0, x1, y1, x, y);
> ^
>
> -- Peter.
>
|