Skip to content

Commit

Permalink
gcc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mholling committed Mar 26, 2024
1 parent bec4042 commit f712324
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 6 additions & 5 deletions src/point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Point> : std::integral_constant<std::size_t, 2> { };

template <std::size_t M>
struct std::tuple_element<M, Point> { using type = double; };

template <>
Bounds::Bounds(Point const &point) {
auto const &[x, y] = point;
xmin = xmax = x, ymin = ymax = y;
}

#endif
4 changes: 2 additions & 2 deletions src/vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

#include "vector.hpp"
#include "bounds.hpp"
#include <tuple>
#include <cstddef>

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<Vertex> {
Expand Down

0 comments on commit f712324

Please sign in to comment.