boostorg / boostorg/geometry

Compilation error for the example of adapted legacy geometry object model

Ouverte
#517 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
documentation good-first-issue
Langage dominant
C++
Étoiles
517
Forks
232
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.