From dc6222611ad14a33f642396558ba84ecba9d6605 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Mar 2022 18:02:18 +0100 Subject: perf: add noexcept almost everywhere --- src/engine/data/bounds.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/engine/data/bounds.hpp') diff --git a/src/engine/data/bounds.hpp b/src/engine/data/bounds.hpp index 9b72f59..4a29158 100644 --- a/src/engine/data/bounds.hpp +++ b/src/engine/data/bounds.hpp @@ -22,15 +22,17 @@ struct BoundsOptions class Bounds { public: - explicit Bounds(const BoundsOptions &options); + using Value = uint32_t; - [[nodiscard]] uint32_t get_width() const noexcept; + explicit Bounds(const BoundsOptions &options) noexcept; - void set_width(uint32_t width) noexcept; + [[nodiscard]] Value get_width() const noexcept; - [[nodiscard]] uint32_t get_height() const noexcept; + void set_width(Value width) noexcept; - void set_height(uint32_t height) noexcept; + [[nodiscard]] Value get_height() const noexcept; + + void set_height(Value height) noexcept; [[nodiscard]] CoordsValidation validate_coords(const Vector2 &coords) const noexcept; @@ -39,6 +41,6 @@ public: const Bounds &operator-=(const Bounds &bounds) noexcept; private: - uint32_t _width = 0U; - uint32_t _height = 0U; + Value _width = 0U; + Value _height = 0U; }; -- cgit v1.2.3-18-g5258