From a039c8ad36779903571419cb06cd052f8fc41512 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 29 Mar 2022 17:40:04 +0200 Subject: refactor: use trailing return types --- src/engine/data/vector2.hpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/engine/data/vector2.hpp') diff --git a/src/engine/data/vector2.hpp b/src/engine/data/vector2.hpp index 78eba11..95baf1c 100644 --- a/src/engine/data/vector2.hpp +++ b/src/engine/data/vector2.hpp @@ -22,30 +22,30 @@ public: { } - [[nodiscard]] Value get_x() const noexcept; + [[nodiscard]] auto get_x() const noexcept -> Value; void set_x(Value x) noexcept; - [[nodiscard]] Value get_y() const noexcept; + [[nodiscard]] auto get_y() const noexcept -> Value; void set_y(Value y) noexcept; - [[nodiscard]] Vector2 to_direction(const Vector2 &direction, - Vector2::Value amount) const noexcept; + [[nodiscard]] auto to_direction(const Vector2 &direction, + Vector2::Value amount) const noexcept -> Vector2; - const Vector2 &operator+=(const Vector2 &rhs) noexcept; - const Vector2 &operator-=(const Vector2 &rhs) noexcept; + auto operator+=(const Vector2 &rhs) noexcept -> const Vector2 &; + auto operator-=(const Vector2 &rhs) noexcept -> const Vector2 &; - Vector2 operator+(const Vector2 &rhs) const noexcept; - Vector2 operator-(const Vector2 &rhs) const noexcept; - Vector2 operator*(const Vector2 &rhs) const noexcept; + auto operator+(const Vector2 &rhs) const noexcept -> Vector2; + auto operator-(const Vector2 &rhs) const noexcept -> Vector2; + auto operator*(const Vector2 &rhs) const noexcept -> Vector2; - bool operator==(const Vector2 &rhs) const noexcept; + auto operator==(const Vector2 &rhs) const noexcept -> bool; /** * Returns Vector2({.x = 0, .y = -1}) */ - static constexpr Vector2 up() noexcept + static constexpr auto up() noexcept -> Vector2 { return Vector2({.x = 0, .y = -1}); } @@ -53,7 +53,7 @@ public: /** * Returns Vector2({.x = 0, .y = 1}) */ - static constexpr Vector2 down() noexcept + static constexpr auto down() noexcept -> Vector2 { return Vector2({.x = 0, .y = 1}); } @@ -61,7 +61,7 @@ public: /** * Returns Vector2({.x = -1, .y = 0}) */ - static constexpr Vector2 left() noexcept + static constexpr auto left() noexcept -> Vector2 { return Vector2({.x = -1, .y = 0}); @@ -70,7 +70,7 @@ public: /** * Returns Vector2({.x = 1, .y = 0}) */ - static constexpr Vector2 right() noexcept + static constexpr auto right() noexcept -> Vector2 { return Vector2({.x = 1, .y = 0}); } @@ -83,5 +83,5 @@ private: class Vector2Hasher { public: - std::size_t operator()(const Vector2 &vector2) const noexcept; + auto operator()(const Vector2 &vector2) const noexcept -> std::size_t; }; -- cgit v1.2.3-18-g5258