From f712324826f7db34ff2cfb1e47b77b11df58a195 Mon Sep 17 00:00:00 2001 From: Matthew Hollingworth Date: Tue, 26 Mar 2024 15:13:50 +1100 Subject: [PATCH] gcc fixes --- Rakefile | 2 +- src/point.hpp | 11 ++++++----- src/vertex.hpp | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index 1016cbb..c514721 100644 --- a/Rakefile +++ b/Rakefile @@ -35,7 +35,7 @@ end desc "test build with gcc" task :gcc do - sh %Q[g++-mp-13 -O3 -std=c++2a -Wfatal-errors -Wall -Wextra -Wpedantic -o /dev/stdout src/main.cpp | wc -c] + sh %Q[g++-mp-13 -O3 -std=c++2a -Wfatal-errors -Wall -Wextra -Wpedantic -Ibuild/lazperf/src/lazperf/cpp -S -o /dev/null src/main.cpp] end desc "download WKT strings and generate src/wkts.hpp" diff --git a/src/point.hpp b/src/point.hpp index f19733e..c9ce086 100644 --- a/src/point.hpp +++ b/src/point.hpp @@ -55,15 +55,16 @@ auto operator>(Point const &p1, Point const &p2) { std::tuple(p2.key_point, p2.ground(), p1.elevation); } -template <> -Bounds::Bounds(Point const &point) { - std::tie(xmin, ymin) = std::tie(xmax, ymax) = point; -} - template <> struct std::tuple_size : std::integral_constant { }; template struct std::tuple_element { using type = double; }; +template <> +Bounds::Bounds(Point const &point) { + auto const &[x, y] = point; + xmin = xmax = x, ymin = ymax = y; +} + #endif diff --git a/src/vertex.hpp b/src/vertex.hpp index 3285653..3bd9c08 100644 --- a/src/vertex.hpp +++ b/src/vertex.hpp @@ -9,14 +9,14 @@ #include "vector.hpp" #include "bounds.hpp" -#include #include using Vertex = Vector<2>; template <> Bounds::Bounds(Vertex const &vertex) { - std::tie(xmin, ymin) = std::tie(xmax, ymax) = vertex; + auto const &[x, y] = vertex; + xmin = xmax = x, ymin = ymax = y; } template <> struct std::hash {