Subject: Re: [geometry] Is "dimensions" signed or unsigned?
From: Patrick J. LoPresti (lopresti_at_[hidden])
Date: 2014-09-22 17:20:48
Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]> writes:
> I fixed signed/unsigned comparison in index/.../is_valid in develop
> The problem with dimension<> metafunction is that the type of the
> value depends on the traits defined for a Geometry. For all models in
> Boost.Geometry int type is used but the user may define it as unsigned
> or size_t, etc. So I'm guessing that we can't be fully consistent
Well, it could be consistent internally... But I see the point about
In fact, that is my current problem :-). From
template <typename Geometry, int Dimensions>
inline void assert_dimension()
For me, geometry::dimension<Geometry> is the dimension of my own type,
which I made unsigned... So the "equal_to" comparison ultimately
compares unsigned vs. signed, triggering the warning.
Similar problems occur with the functions immediately below
> Of course if you think that something could be improved, not only this
> issue, patches are more than welcome.
> In case you didn't know, here is a tutorial:
I have taken a crack at fixing the signed/unsigned warnings from
coordinate_dimension.hpp and sent the pull request.
Geometry list run by mateusz at loskot.net