|
Geometry : |
Subject: Re: [geometry] How far should I expect to get with points that are "values"?
From: Patrick J. LoPresti (lopresti_at_[hidden])
Date: 2014-07-16 19:22:16
Barend Gehrels <barend_at_[hidden]> writes:
> Why is this not an option? You don't to have setters or getters. If
> you use this macro without the const, it just creates traits to get
> and set x,y directly.
Sorry; I did not explain myself very well. My actual code looks more
like this:
struct MyPoint {
//
// constructors, getters, etc. (but no setters)
//
private:
__m128i vec;
};
I was trying to provide a minimal compilable example to illustrate a
failure I was not expecting.
> The _CONST suffix means that the set part of the traits is not
> implemented. But Boost.Geometry can therefore not create any point
> then.
OK... But why not? Don't 2D points -- especially "value class" points --
generally have a constructor accepting the x,y components as arguments?
I suppose you do not want Boost.Geometry to assume that (?) But then a
lot of things in the library will never work with value classes.
> No, that is not necessary. It should work fine like this.
I guess I am curious what is the point (no pun intended) of
BOOST_GEOMETRY_REGISTER_POINT_2D_CONST if most of the algorithms are not
going to work with such points. Also I am curious how to know what I
should expect to work and not to work, apart from just trying it...
Thanks!
- Pat
Geometry list run by mateusz at loskot.net