aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/vector2.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-29 17:40:04 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:57 +0200
commita039c8ad36779903571419cb06cd052f8fc41512 (patch)
tree4fdced6941a048bdd4b032fab7012bca00a6028e /src/engine/data/vector2.hpp
parentacf72075ed32e5a679d49ffedc0c28d8ac2aea8b (diff)
refactor: use trailing return types
Diffstat (limited to 'src/engine/data/vector2.hpp')
-rw-r--r--src/engine/data/vector2.hpp30
1 files changed, 15 insertions, 15 deletions
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;
};