diff options
Diffstat (limited to 'src/local-coords.hpp')
| -rw-r--r-- | src/local-coords.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/local-coords.hpp b/src/local-coords.hpp index d2520a42..b63f3db8 100644 --- a/src/local-coords.hpp +++ b/src/local-coords.hpp @@ -9,21 +9,21 @@ namespace Magnum::Examples { struct local_coords final { std::uint8_t x = 0, y = 0; - explicit constexpr local_coords(std::size_t idx); - constexpr local_coords() = default; - constexpr local_coords(std::size_t x, std::size_t y); - constexpr local_coords(std::uint8_t x, std::uint8_t y) : x{x}, y{y} {} - constexpr std::size_t to_index() const { return y*TILE_MAX_DIM + x; } + explicit constexpr local_coords(std::size_t idx) noexcept; // NOLINT(bugprone-exception-escape) + constexpr local_coords() noexcept = default; + constexpr local_coords(std::size_t x, std::size_t y) noexcept; // NOLINT(bugprone-exception-escape) + constexpr local_coords(std::uint8_t x, std::uint8_t y) noexcept : x{x}, y{y} {} + constexpr std::size_t to_index() const noexcept { return y*TILE_MAX_DIM + x; } }; -constexpr local_coords::local_coords(std::size_t index) : +constexpr local_coords::local_coords(std::size_t index) noexcept : // NOLINT(bugprone-exception-escape) x{(std::uint8_t)(index % TILE_MAX_DIM)}, y{(std::uint8_t)(index / TILE_MAX_DIM)} { ASSERT(index < TILE_COUNT); } -constexpr local_coords::local_coords(std::size_t x, std::size_t y) +constexpr local_coords::local_coords(std::size_t x, std::size_t y) noexcept // NOLINT(bugprone-exception-escape) : x{(std::uint8_t)x}, y{(std::uint8_t)y} { ASSERT(x <= 0xff && y <= 0xff); |
