boostorg / boostorg/geometry

Compilation error for the example of adapted legacy geometry object model

オープン
#517 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
documentation good-first-issue
主要言語
C++
スター
517
フォーク
232
PR マージ指標
30日以内にマージされた PR はありません

説明

Trying the example code
[Example model](https://www.boost.org/doc/libs/1_68_0/libs/geometry/doc/html/geometry/examples/example__adapting_a_legacy_geometry_object_model.html)
[Adapted example model](https://www.boost.org/doc/libs/1_68_0/libs/geometry/doc/html/geometry/examples/example_source_code__adapting_a_legacy_geometry_object_model.html)

... I got the following build error (Visual Studio 15.8.6):
```
namespace bg = boost::geometry;

int main()
{
QPolygon polygon;
std::vector points = { {0,0}, {0,1}, {1,0} };
bg::append(polygon, points);
}
```

Error C2664 'void boost::geometry::detail::append::append_range::apply(Geometry &,const Range &,int,int)': cannot convert argument 1 from 'const QRing' to 'Geometry &' BoostGeometryExample ...\boost.1.68.0.0\lib\native\include\boost\geometry\algorithms\append.hpp 127

This error is pointing to the following code in append.hpp:

```
template
struct range_to_polygon
{
typedef typename ring_type::type ring_type;

static inline void apply(Polygon& polygon, Range const& range,
int ring_index, int = 0)
{
if (ring_index == -1)
{
append_range::apply(
exterior_ring(polygon), range);
}
else if (ring_index < int(num_interior_rings(polygon)))
{
append_range::apply(
range::at(interior_rings(polygon), ring_index), range);
}
}
};
```

The r-value returned by `interior_rings` might be being linked to a const& and assume that this might be causing the error.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。