diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-29 17:40:04 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:57 +0200 |
commit | a039c8ad36779903571419cb06cd052f8fc41512 (patch) | |
tree | 4fdced6941a048bdd4b032fab7012bca00a6028e /src/engine/data/bounds.cpp | |
parent | acf72075ed32e5a679d49ffedc0c28d8ac2aea8b (diff) |
refactor: use trailing return types
Diffstat (limited to 'src/engine/data/bounds.cpp')
-rw-r--r-- | src/engine/data/bounds.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/engine/data/bounds.cpp b/src/engine/data/bounds.cpp index 1a8c4d0..ca67008 100644 --- a/src/engine/data/bounds.cpp +++ b/src/engine/data/bounds.cpp @@ -5,7 +5,7 @@ Bounds::Bounds(const BoundsOptions &options) noexcept { } -Bounds::Value Bounds::get_width() const noexcept +auto Bounds::get_width() const noexcept -> Bounds::Value { return _width; } @@ -15,7 +15,7 @@ void Bounds::set_width(Bounds::Value width) noexcept _width = width; } -Bounds::Value Bounds::get_height() const noexcept +auto Bounds::get_height() const noexcept -> Bounds::Value { return _height; } @@ -25,7 +25,7 @@ void Bounds::set_height(Bounds::Value height) noexcept _height = height; } -CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept +auto Bounds::validate_coords(const Vector2 &coords) const noexcept -> CoordsValidation { if (static_cast<Bounds::Value>(coords.get_x()) >= _width) { @@ -50,7 +50,7 @@ CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept return CoordsValidation::VALID; } -const Bounds &Bounds::operator*=(const Bounds &rhs) noexcept +auto Bounds::operator*=(const Bounds &rhs) noexcept -> const Bounds & { _width *= rhs._width; _height *= rhs._height; @@ -58,7 +58,7 @@ const Bounds &Bounds::operator*=(const Bounds &rhs) noexcept return *this; } -const Bounds &Bounds::operator+=(const Bounds &rhs) noexcept +auto Bounds::operator+=(const Bounds &rhs) noexcept -> const Bounds & { _width += rhs._width; _height += rhs._height; @@ -66,7 +66,7 @@ const Bounds &Bounds::operator+=(const Bounds &rhs) noexcept return *this; } -const Bounds &Bounds::operator-=(const Bounds &rhs) noexcept +auto Bounds::operator-=(const Bounds &rhs) noexcept -> const Bounds & { _width -= rhs._width; _height -= rhs._height; @@ -74,7 +74,7 @@ const Bounds &Bounds::operator-=(const Bounds &rhs) noexcept return *this; } -Bounds Bounds::operator-(const Bounds &rhs) const noexcept +auto Bounds::operator-(const Bounds &rhs) const noexcept -> Bounds { auto new_bounds = Bounds(*this); |