Subject: Re: [geometry] Run-Time specified geometries
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-10-25 19:14:15
On 25 October 2013 17:53, Bruno Lalande <bruno.lalande_at_[hidden]> wrote:
>> That raise the question how to report runtime errors ?
>> Exception ?
> It's not a runtime error, as variant types are a compile time information.
> Applying the multi stage resolution as described above will automatically
> reject any variant that could possibly result in trying to compute the
> distance between a 2D and a 3G geometry - e.g. passing instances of
> variant<point<double, 2>, point<double, 3> > in parameters for distance will
> result in a compile time error. One might argue it's too conservative, as at
> run-time we won't necessarily end up asking for the fatal combination. But I
> want to leverage variants type safety as much as possible.
I suppose, users may define views to adapt the 3d geometry as 2d
and pass to 2d-aware algorithms in unified form.
-- Mateusz Loskot, http://mateusz.loskot.net
Geometry list run by mateusz at loskot.net