boostorg / boostorg/polygon

Crash with VS 16.8.6 but working with clang 11/13 and gcc 11

Open
#63 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
70
Forks
75
PR merge metrics
No merged PRs in 30d

Description

Hi there,

We encountered a weird error running the following code using boost::polygon.

It is compiling and working on:
- wandbox.org using clang/gcc
- and on macOS using Apple clang 11.0.3.

and compiling but crashing with cl from Visual Studio 16.8.6.

Do you have any idea about what is going on please?

Cheers,
Nicolas

```
#include
#include

int main()
{
using Polygon = boost::polygon::polygon_data;
using PolygonPoints = std::vector;
PolygonPoints polygonPoints{
{ 0, 0 },
{ -37570000, 37568665 },
{ -233490372, -195921616 },
};
Polygon const polygon{ std::begin(polygonPoints), std::end(polygonPoints) };

boost::polygon::polygon_set_data polygonSet;
polygonSet.insert(polygon);

std::vector trapezoids;
polygonSet.get_trapezoids(trapezoids);

std::cout << "#trapezoids: " << trapezoids.size() << std::endl;

auto index{ 0 };

for (auto const& trapezoid: trapezoids)
{
std::cout << "trapezoid " << index << ":" << std::endl;
auto pointIndex{ 0 };

for (auto const& coord: trapezoid.coords_)
{
std::cout << "point " << pointIndex << ": " << coord.x() << "; " << coord.y() << std::endl;
++pointIndex;
}

++index;
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.