diff --git a/Delynoi/src/models/neighbourhood/PointMap.cpp b/Delynoi/src/models/neighbourhood/PointMap.cpp index 22d4c0e..7c71643 100644 --- a/Delynoi/src/models/neighbourhood/PointMap.cpp +++ b/Delynoi/src/models/neighbourhood/PointMap.cpp @@ -52,9 +52,9 @@ void PointMap::printInPath(const std::string &path) const { std::ofstream file; file.open(path, std::ios::out); - for (const auto &[fst, snd]: this->map) { - file << fst.getString() + " "; - NeighboursByPoint n = snd; + for (const auto &v: this->map) { // Structured binding only C++ std17 + file << v.first.getString() + " "; + NeighboursByPoint n = v.second; for (const int i: n.getNeighbours()) { file << i << " "; diff --git a/Delynoi/src/models/neighbourhood/SegmentMap.cpp b/Delynoi/src/models/neighbourhood/SegmentMap.cpp index 2018b37..f790865 100644 --- a/Delynoi/src/models/neighbourhood/SegmentMap.cpp +++ b/Delynoi/src/models/neighbourhood/SegmentMap.cpp @@ -46,8 +46,8 @@ void SegmentMap::printInPath(const std::string &path) const { std::ofstream file; file.open(path, std::ios::out); - for (const auto &[fst, snd]: this->map) { - file << fst.getString() + " " + snd.getString() << std::endl; + for (const auto &v: this->map) { // Structured binding only C++ std17 + file << v.first.getString() + " " + v.second.getString() << std::endl; } file.close(); diff --git a/Delynoi/src/triangulation/CenterTriangulationGenerator.cpp b/Delynoi/src/triangulation/CenterTriangulationGenerator.cpp index 21a2b35..9b17709 100644 --- a/Delynoi/src/triangulation/CenterTriangulationGenerator.cpp +++ b/Delynoi/src/triangulation/CenterTriangulationGenerator.cpp @@ -16,7 +16,8 @@ std::vector CenterTriangulationGenerator::triangulate(Polygon p, std:: const int centerIndex = points.size() - 1; for (int i = 0; i < n; ++i) { - const std::vector trianglePoints = {polyPoints[i], polyPoints[(i + 1) % n], centerIndex}; + // ReSharper disable once CppTemplateArgumentsCanBeDeduced + const std::vector trianglePoints = {polyPoints[i], polyPoints[(i + 1) % n], centerIndex}; // MacOS requires int Triangle t(trianglePoints, points); triangles.push_back(t); diff --git a/Delynoi/src/triangulation/EarTriangulationGenerator.cpp b/Delynoi/src/triangulation/EarTriangulationGenerator.cpp index fdccc14..d83867f 100644 --- a/Delynoi/src/triangulation/EarTriangulationGenerator.cpp +++ b/Delynoi/src/triangulation/EarTriangulationGenerator.cpp @@ -17,7 +17,8 @@ Triangle EarTriangulationGenerator::getEar(const std::vector &points, std } for (int i = 0; i < size; i++) { - if (Triangle t({pointList[(size + i - 1) % size], pointList[i % size], pointList[(size + i + 1) % size]}, points); t.isConvex(points)) { + Triangle t({pointList[(size + i - 1) % size], pointList[i % size], pointList[(size + i + 1) % size]}, points); + if (t.isConvex(points)) { bool test = false; for (int j = 0; j < size; j++) { if (!t.isVertex(pointList[j]) && t.containsPoint(points, points[pointList[j]])) {