Compilation error for the example of adapted legacy geometry object model
- 主要言語
- 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 はまだ評価されていません。