aboutsummaryrefslogtreecommitdiff
path: root/src/engine
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
parentacf72075ed32e5a679d49ffedc0c28d8ac2aea8b (diff)
refactor: use trailing return types
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/data/bounds.cpp14
-rw-r--r--src/engine/data/bounds.hpp14
-rw-r--r--src/engine/data/vector2.cpp22
-rw-r--r--src/engine/data/vector2.hpp30
-rw-r--r--src/engine/graphics/matrix.hpp14
-rw-r--r--src/engine/graphics/matrix.tpp14
-rw-r--r--src/engine/graphics/scene.cpp2
-rw-r--r--src/engine/graphics/scene.hpp4
-rw-r--r--src/engine/graphics/window.cpp2
-rw-r--r--src/engine/graphics/window.hpp2
-rw-r--r--src/engine/matrix_iterator.hpp24
-rw-r--r--src/engine/matrix_iterator.tpp24
-rw-r--r--src/engine/user/cursor.cpp2
-rw-r--r--src/engine/user/cursor.hpp2
-rw-r--r--src/engine/user/input.cpp4
-rw-r--r--src/engine/user/input.hpp2
16 files changed, 88 insertions, 88 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);
diff --git a/src/engine/data/bounds.hpp b/src/engine/data/bounds.hpp
index ccea2c3..5444503 100644
--- a/src/engine/data/bounds.hpp
+++ b/src/engine/data/bounds.hpp
@@ -26,21 +26,21 @@ public:
explicit Bounds(const BoundsOptions &options) noexcept;
- [[nodiscard]] Value get_width() const noexcept;
+ [[nodiscard]] auto get_width() const noexcept -> Value;
void set_width(Value width) noexcept;
- [[nodiscard]] Value get_height() const noexcept;
+ [[nodiscard]] auto get_height() const noexcept -> Value;
void set_height(Value height) noexcept;
- [[nodiscard]] CoordsValidation validate_coords(const Vector2 &coords) const noexcept;
+ [[nodiscard]] auto validate_coords(const Vector2 &coords) const noexcept -> CoordsValidation;
- const Bounds &operator*=(const Bounds &rhs) noexcept;
- const Bounds &operator+=(const Bounds &rhs) noexcept;
- const Bounds &operator-=(const Bounds &rhs) noexcept;
+ auto operator*=(const Bounds &rhs) noexcept -> const Bounds &;
+ auto operator+=(const Bounds &rhs) noexcept -> const Bounds &;
+ auto operator-=(const Bounds &rhs) noexcept -> const Bounds &;
- Bounds operator-(const Bounds &rhs) const noexcept;
+ auto operator-(const Bounds &rhs) const noexcept -> Bounds;
private:
Value _width = 0U;
diff --git a/src/engine/data/vector2.cpp b/src/engine/data/vector2.cpp
index b838051..0554930 100644
--- a/src/engine/data/vector2.cpp
+++ b/src/engine/data/vector2.cpp
@@ -2,7 +2,7 @@
#include "util/hash.hpp"
-Vector2::Value Vector2::get_x() const noexcept
+auto Vector2::get_x() const noexcept -> Vector2::Value
{
return _x;
}
@@ -12,7 +12,7 @@ void Vector2::set_x(Vector2::Value x) noexcept
_x = x;
}
-Vector2::Value Vector2::get_y() const noexcept
+auto Vector2::get_y() const noexcept -> Vector2::Value
{
return _y;
}
@@ -22,13 +22,13 @@ void Vector2::set_y(Vector2::Value y) noexcept
_y = y;
}
-Vector2 Vector2::to_direction(const Vector2 &direction,
- Vector2::Value amount) const noexcept
+auto Vector2::to_direction(const Vector2 &direction,
+ Vector2::Value amount) const noexcept -> Vector2
{
return *this + (direction * Vector2({.x = amount, .y = amount}));
}
-const Vector2 &Vector2::operator+=(const Vector2 &rhs) noexcept
+auto Vector2::operator+=(const Vector2 &rhs) noexcept -> const Vector2 &
{
_x += rhs._x;
_y += rhs._y;
@@ -36,7 +36,7 @@ const Vector2 &Vector2::operator+=(const Vector2 &rhs) noexcept
return *this;
}
-const Vector2 &Vector2::operator-=(const Vector2 &rhs) noexcept
+auto Vector2::operator-=(const Vector2 &rhs) noexcept -> const Vector2 &
{
_x -= rhs._x;
_y -= rhs._y;
@@ -44,7 +44,7 @@ const Vector2 &Vector2::operator-=(const Vector2 &rhs) noexcept
return *this;
}
-Vector2 Vector2::operator+(const Vector2 &rhs) const noexcept
+auto Vector2::operator+(const Vector2 &rhs) const noexcept -> Vector2
{
auto new_vector2 = Vector2(*this);
@@ -54,7 +54,7 @@ Vector2 Vector2::operator+(const Vector2 &rhs) const noexcept
return new_vector2;
}
-Vector2 Vector2::operator-(const Vector2 &rhs) const noexcept
+auto Vector2::operator-(const Vector2 &rhs) const noexcept -> Vector2
{
auto new_vector2 = Vector2(*this);
@@ -64,7 +64,7 @@ Vector2 Vector2::operator-(const Vector2 &rhs) const noexcept
return new_vector2;
}
-Vector2 Vector2::operator*(const Vector2 &rhs) const noexcept
+auto Vector2::operator*(const Vector2 &rhs) const noexcept -> Vector2
{
auto new_vector2 = *this;
@@ -74,12 +74,12 @@ Vector2 Vector2::operator*(const Vector2 &rhs) const noexcept
return new_vector2;
}
-bool Vector2::operator==(const Vector2 &rhs) const noexcept
+auto Vector2::operator==(const Vector2 &rhs) const noexcept -> bool
{
return _x == rhs._x && _y == rhs._y;
}
-std::size_t Vector2Hasher::operator()(const Vector2 &vector2) const noexcept
+auto Vector2Hasher::operator()(const Vector2 &vector2) const noexcept -> std::size_t
{
std::size_t result_hash = 0;
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;
};
diff --git a/src/engine/graphics/matrix.hpp b/src/engine/graphics/matrix.hpp
index 2c9ba81..f71018b 100644
--- a/src/engine/graphics/matrix.hpp
+++ b/src/engine/graphics/matrix.hpp
@@ -23,21 +23,21 @@ public:
void fill(Element element) noexcept override;
- [[nodiscard]] Element get(const Vector2 &pos) const noexcept override;
+ [[nodiscard]] auto get(const Vector2 &pos) const noexcept -> Element override;
void set(const Vector2 &pos, Element element) noexcept override;
- [[nodiscard]] uint32_t get_row_cnt() const noexcept override;
+ [[nodiscard]] auto get_row_cnt() const noexcept -> uint32_t override;
- [[nodiscard]] uint32_t get_column_cnt() const noexcept override;
+ [[nodiscard]] auto get_column_cnt() const noexcept -> uint32_t override;
- [[nodiscard]] MatrixIterator<Element> begin() const noexcept override;
+ [[nodiscard]] auto begin() const noexcept -> MatrixIterator<Element> override;
- [[nodiscard]] MatrixIterator<Element> end() const noexcept override;
+ [[nodiscard]] auto end() const noexcept -> MatrixIterator<Element> override;
- Matrix &operator=(const Matrix &rhs) noexcept;
+ auto operator=(const Matrix &rhs) noexcept -> Matrix &;
- Matrix &operator=(Matrix &&rhs) noexcept;
+ auto operator=(Matrix &&rhs) noexcept -> Matrix &;
private:
gsl::owner<Element **> _matrix;
diff --git a/src/engine/graphics/matrix.tpp b/src/engine/graphics/matrix.tpp
index e0e65bb..527c61f 100644
--- a/src/engine/graphics/matrix.tpp
+++ b/src/engine/graphics/matrix.tpp
@@ -49,7 +49,7 @@ void Matrix<Element>::fill(Element element) noexcept
}
template <typename Element>
-Element Matrix<Element>::get(const Vector2 &pos) const noexcept
+auto Matrix<Element>::get(const Vector2 &pos) const noexcept -> Element
{
auto x = static_cast<std::size_t>(pos.get_x());
@@ -70,31 +70,31 @@ void Matrix<Element>::set(const Vector2 &pos, Element element) noexcept
}
template <typename Element>
-uint32_t Matrix<Element>::get_row_cnt() const noexcept
+auto Matrix<Element>::get_row_cnt() const noexcept -> uint32_t
{
return _row_cnt;
}
template <typename Element>
-uint32_t Matrix<Element>::get_column_cnt() const noexcept
+auto Matrix<Element>::get_column_cnt() const noexcept -> uint32_t
{
return _column_cnt;
}
template <typename Element>
-MatrixIterator<Element> Matrix<Element>::begin() const noexcept
+auto Matrix<Element>::begin() const noexcept -> MatrixIterator<Element>
{
return MatrixIterator(_matrix, _column_cnt);
}
template <typename Element>
-MatrixIterator<Element> Matrix<Element>::end() const noexcept
+auto Matrix<Element>::end() const noexcept -> MatrixIterator<Element>
{
return MatrixIterator(_matrix + _row_cnt, _column_cnt);
}
template <typename Element>
-Matrix<Element> &Matrix<Element>::operator=(const Matrix &rhs) noexcept
+auto Matrix<Element>::operator=(const Matrix &rhs) noexcept -> Matrix<Element> &
{
if (&rhs != this)
{
@@ -111,7 +111,7 @@ Matrix<Element> &Matrix<Element>::operator=(const Matrix &rhs) noexcept
}
template <typename Element>
-Matrix<Element> &Matrix<Element>::operator=(Matrix &&rhs) noexcept
+auto Matrix<Element>::operator=(Matrix &&rhs) noexcept -> Matrix<Element> &
{
if (&rhs != this)
{
diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp
index 24c174f..c27a6d5 100644
--- a/src/engine/graphics/scene.cpp
+++ b/src/engine/graphics/scene.cpp
@@ -45,7 +45,7 @@ void Scene::leave() noexcept
_is_shown = false;
}
-const std::shared_ptr<IMatrix<std::string_view>> &Scene::get_matrix() const noexcept
+auto Scene::get_matrix() const noexcept -> const std::shared_ptr<IMatrix<std::string_view>> &
{
return _matrix;
}
diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp
index c4f6d67..3dcaa2d 100644
--- a/src/engine/graphics/scene.hpp
+++ b/src/engine/graphics/scene.hpp
@@ -23,8 +23,8 @@ public:
void leave() noexcept override;
- [[nodiscard]] const std::shared_ptr<IMatrix<std::string_view>> &
- get_matrix() const noexcept override;
+ [[nodiscard]] auto
+ get_matrix() const noexcept -> const std::shared_ptr<IMatrix<std::string_view>> & override;
private:
bool _is_shown;
diff --git a/src/engine/graphics/window.cpp b/src/engine/graphics/window.cpp
index d6bae0c..bb33402 100644
--- a/src/engine/graphics/window.cpp
+++ b/src/engine/graphics/window.cpp
@@ -2,7 +2,7 @@
#include <sys/ioctl.h>
-Bounds Window::size() const noexcept
+auto Window::size() const noexcept -> Bounds
{
winsize window_size = {};
diff --git a/src/engine/graphics/window.hpp b/src/engine/graphics/window.hpp
index c9a9c70..69c04c3 100644
--- a/src/engine/graphics/window.hpp
+++ b/src/engine/graphics/window.hpp
@@ -10,5 +10,5 @@ class Window : public IWindow, public AutoWirable<IWindow, Window>
public:
Window() noexcept = default;
- [[nodiscard]] Bounds size() const noexcept override;
+ [[nodiscard]] auto size() const noexcept -> Bounds override;
};
diff --git a/src/engine/matrix_iterator.hpp b/src/engine/matrix_iterator.hpp
index 5d35052..674216f 100644
--- a/src/engine/matrix_iterator.hpp
+++ b/src/engine/matrix_iterator.hpp
@@ -10,13 +10,13 @@ public:
explicit MatrixRowIterator(ColumnPtr column_ptr) noexcept;
- MatrixRowIterator &operator++() noexcept;
- MatrixRowIterator operator++(int) noexcept;
+ auto operator++() noexcept -> MatrixRowIterator &;
+ auto operator++(int) noexcept -> MatrixRowIterator;
- Element &operator*() const noexcept;
+ auto operator*() const noexcept -> Element &;
- bool operator==(const MatrixRowIterator &rhs) const noexcept;
- bool operator!=(const MatrixRowIterator &rhs) const noexcept;
+ auto operator==(const MatrixRowIterator &rhs) const noexcept -> bool;
+ auto operator!=(const MatrixRowIterator &rhs) const noexcept -> bool;
private:
ColumnPtr _column_ptr;
@@ -30,9 +30,9 @@ public:
explicit MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexcept;
- [[nodiscard]] MatrixRowIterator<Element> begin() const noexcept;
+ [[nodiscard]] auto begin() const noexcept -> MatrixRowIterator<Element>;
- [[nodiscard]] MatrixRowIterator<Element> end() const noexcept;
+ [[nodiscard]] auto end() const noexcept -> MatrixRowIterator<Element>;
private:
RowPtr _row_ptr;
@@ -48,13 +48,13 @@ public:
explicit MatrixIterator(RowPtr row_ptr, const uint32_t &column_cnt) noexcept;
- MatrixIterator &operator++() noexcept;
- MatrixIterator operator++(int) noexcept;
+ auto operator++() noexcept -> MatrixIterator &;
+ auto operator++(int) noexcept -> MatrixIterator;
- MatrixRow<Element> operator*() const noexcept;
+ auto operator*() const noexcept -> MatrixRow<Element>;
- bool operator==(const MatrixIterator &rhs) const noexcept;
- bool operator!=(const MatrixIterator &rhs) const noexcept;
+ auto operator==(const MatrixIterator &rhs) const noexcept -> bool;
+ auto operator!=(const MatrixIterator &rhs) const noexcept -> bool;
private:
RowPtr _row_ptr;
diff --git a/src/engine/matrix_iterator.tpp b/src/engine/matrix_iterator.tpp
index 52952c9..031136c 100644
--- a/src/engine/matrix_iterator.tpp
+++ b/src/engine/matrix_iterator.tpp
@@ -11,7 +11,7 @@ MatrixRowIterator<Element>::MatrixRowIterator(ColumnPtr column_ptr) noexcept
}
template <typename Element>
-MatrixRowIterator<Element> &MatrixRowIterator<Element>::operator++() noexcept
+auto MatrixRowIterator<Element>::operator++() noexcept -> MatrixRowIterator<Element> &
{
++_column_ptr;
@@ -19,7 +19,7 @@ MatrixRowIterator<Element> &MatrixRowIterator<Element>::operator++() noexcept
}
template <typename Element>
-MatrixRowIterator<Element> MatrixRowIterator<Element>::operator++(int) noexcept
+auto MatrixRowIterator<Element>::operator++(int) noexcept -> MatrixRowIterator<Element>
{
auto copy = *this;
@@ -29,19 +29,19 @@ MatrixRowIterator<Element> MatrixRowIterator<Element>::operator++(int) noexcept
}
template <typename Element>
-Element &MatrixRowIterator<Element>::operator*() const noexcept
+auto MatrixRowIterator<Element>::operator*() const noexcept -> Element &
{
return *_column_ptr;
}
template <typename Element>
-bool MatrixRowIterator<Element>::operator==(const MatrixRowIterator &rhs) const noexcept
+auto MatrixRowIterator<Element>::operator==(const MatrixRowIterator &rhs) const noexcept -> bool
{
return _column_ptr == rhs._column_ptr;
}
template <typename Element>
-bool MatrixRowIterator<Element>::operator!=(const MatrixRowIterator &rhs) const noexcept
+auto MatrixRowIterator<Element>::operator!=(const MatrixRowIterator &rhs) const noexcept -> bool
{
return _column_ptr != rhs._column_ptr;
}
@@ -55,13 +55,13 @@ MatrixRow<Element>::MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexce
}
template <typename Element>
-MatrixRowIterator<Element> MatrixRow<Element>::begin() const noexcept
+auto MatrixRow<Element>::begin() const noexcept -> MatrixRowIterator<Element>
{
return MatrixRowIterator<Element>(_row_ptr);
}
template <typename Element>
-MatrixRowIterator<Element> MatrixRow<Element>::end() const noexcept
+auto MatrixRow<Element>::end() const noexcept -> MatrixRowIterator<Element>
{
return MatrixRowIterator<Element>(_row_ptr + _column_cnt);
}
@@ -76,7 +76,7 @@ MatrixIterator<Element>::MatrixIterator(RowPtr row_ptr,
}
template <typename Element>
-MatrixIterator<Element> &MatrixIterator<Element>::operator++() noexcept
+auto MatrixIterator<Element>::operator++() noexcept -> MatrixIterator<Element> &
{
++_row_ptr;
@@ -84,7 +84,7 @@ MatrixIterator<Element> &MatrixIterator<Element>::operator++() noexcept
}
template <typename Element>
-MatrixIterator<Element> MatrixIterator<Element>::operator++(int) noexcept
+auto MatrixIterator<Element>::operator++(int) noexcept -> MatrixIterator<Element>
{
auto copy = *this;
@@ -94,19 +94,19 @@ MatrixIterator<Element> MatrixIterator<Element>::operator++(int) noexcept
}
template <typename Element>
-MatrixRow<Element> MatrixIterator<Element>::operator*() const noexcept
+auto MatrixIterator<Element>::operator*() const noexcept -> MatrixRow<Element>
{
return MatrixRow(*_row_ptr, _column_cnt);
}
template <typename Element>
-bool MatrixIterator<Element>::operator==(const MatrixIterator &rhs) const noexcept
+auto MatrixIterator<Element>::operator==(const MatrixIterator &rhs) const noexcept -> bool
{
return _row_ptr == rhs._row_ptr;
}
template <typename Element>
-bool MatrixIterator<Element>::operator!=(const MatrixIterator &rhs) const noexcept
+auto MatrixIterator<Element>::operator!=(const MatrixIterator &rhs) const noexcept -> bool
{
return _row_ptr != rhs._row_ptr;
}
diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp
index 2a72663..2b240b9 100644
--- a/src/engine/user/cursor.cpp
+++ b/src/engine/user/cursor.cpp
@@ -34,7 +34,7 @@ void CursorController::move_to(const Vector2 &position, bool silent) noexcept
}
}
-Vector2 CursorController::where() const noexcept
+auto CursorController::where() const noexcept -> Vector2
{
return _position;
}
diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp
index fd75374..ccdf71a 100644
--- a/src/engine/user/cursor.hpp
+++ b/src/engine/user/cursor.hpp
@@ -39,7 +39,7 @@ public:
void move_to(const Vector2 &position, bool silent) noexcept override;
- [[nodiscard]] Vector2 where() const noexcept override;
+ [[nodiscard]] auto where() const noexcept -> Vector2 override;
void ensure_position() noexcept override;
diff --git a/src/engine/user/input.cpp b/src/engine/user/input.cpp
index 81fe2f6..87d8a68 100644
--- a/src/engine/user/input.cpp
+++ b/src/engine/user/input.cpp
@@ -60,8 +60,8 @@ void InputHandler::leave_raw_mode() noexcept
_original_termios = nullptr;
}
-InputHandler::_SubscribersSizeType
-InputHandler::_event_as_index(const Event &event) noexcept
+auto
+InputHandler::_event_as_index(const Event &event) noexcept -> InputHandler::_SubscribersSizeType
{
return static_cast<_SubscribersSizeType>(static_cast<uint8_t>(event));
}
diff --git a/src/engine/user/input.hpp b/src/engine/user/input.hpp
index f86d0d0..0a437ef 100644
--- a/src/engine/user/input.hpp
+++ b/src/engine/user/input.hpp
@@ -36,5 +36,5 @@ private:
using _SubscribersSizeType = decltype(_subscribers)::size_type;
- static _SubscribersSizeType _event_as_index(const Event &event) noexcept;
+ static auto _event_as_index(const Event &event) noexcept -> _SubscribersSizeType;
};