From 11ec487eadc7636cc09b6fc2714567a9a88505e7 Mon Sep 17 00:00:00 2001 From: Yannick Stade <100073938+ystade@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:19:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Offer=20more=20constructors=20fo?= =?UTF-8?q?r=20locations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/mqt-core/na/entities/Location.hpp | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/mqt-core/na/entities/Location.hpp b/include/mqt-core/na/entities/Location.hpp index c5e57c353..60951f93f 100644 --- a/include/mqt-core/na/entities/Location.hpp +++ b/include/mqt-core/na/entities/Location.hpp @@ -20,7 +20,31 @@ namespace na { struct Location final { double x = 0; double y = 0; + Location(const float x, const float y) + : x(static_cast(x)), y(static_cast(y)) {}; Location(const double x, const double y) : x(x), y(y) {}; + Location(const std::int32_t x, const std::int32_t y) + : x(static_cast(x)), y(static_cast(y)) {}; + Location(const std::int64_t x, const std::int64_t y) + : x(static_cast(x)), y(static_cast(y)) {}; + Location(const std::uint32_t x, const std::uint32_t y) + : x(static_cast(x)), y(static_cast(y)) {}; + Location(const std::uint64_t x, const std::uint64_t y) + : x(static_cast(x)), y(static_cast(y)) {}; + Location(const std::size_t x, const std::size_t y) + : x(static_cast(x)), y(static_cast(y)) {}; + Location(const std::pair p) : Location(p.first, p.second) {}; + Location(const std::pair p) : Location(p.first, p.second) {}; + Location(const std::pair p) + : Location(p.first, p.second) {}; + Location(const std::pair p) + : Location(p.first, p.second) {}; + Location(const std::pair p) + : Location(p.first, p.second) {}; + Location(const std::pair p) + : Location(p.first, p.second) {}; + Location(const std::pair p) + : Location(p.first, p.second) {}; Location() = default; Location(const Location& loc) = default; Location(Location&& loc) noexcept = default;