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/graphics/matrix.hpp | 14 +++++++------- src/engine/graphics/matrix.tpp | 14 +++++++------- src/engine/graphics/scene.cpp | 2 +- src/engine/graphics/scene.hpp | 4 ++-- src/engine/graphics/window.cpp | 2 +- src/engine/graphics/window.hpp | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/engine/graphics') 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 begin() const noexcept override; + [[nodiscard]] auto begin() const noexcept -> MatrixIterator override; - [[nodiscard]] MatrixIterator end() const noexcept override; + [[nodiscard]] auto end() const noexcept -> MatrixIterator 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 _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::fill(Element element) noexcept } template -Element Matrix::get(const Vector2 &pos) const noexcept +auto Matrix::get(const Vector2 &pos) const noexcept -> Element { auto x = static_cast(pos.get_x()); @@ -70,31 +70,31 @@ void Matrix::set(const Vector2 &pos, Element element) noexcept } template -uint32_t Matrix::get_row_cnt() const noexcept +auto Matrix::get_row_cnt() const noexcept -> uint32_t { return _row_cnt; } template -uint32_t Matrix::get_column_cnt() const noexcept +auto Matrix::get_column_cnt() const noexcept -> uint32_t { return _column_cnt; } template -MatrixIterator Matrix::begin() const noexcept +auto Matrix::begin() const noexcept -> MatrixIterator { return MatrixIterator(_matrix, _column_cnt); } template -MatrixIterator Matrix::end() const noexcept +auto Matrix::end() const noexcept -> MatrixIterator { return MatrixIterator(_matrix + _row_cnt, _column_cnt); } template -Matrix &Matrix::operator=(const Matrix &rhs) noexcept +auto Matrix::operator=(const Matrix &rhs) noexcept -> Matrix & { if (&rhs != this) { @@ -111,7 +111,7 @@ Matrix &Matrix::operator=(const Matrix &rhs) noexcept } template -Matrix &Matrix::operator=(Matrix &&rhs) noexcept +auto Matrix::operator=(Matrix &&rhs) noexcept -> Matrix & { 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> &Scene::get_matrix() const noexcept +auto Scene::get_matrix() const noexcept -> const std::shared_ptr> & { 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> & - get_matrix() const noexcept override; + [[nodiscard]] auto + get_matrix() const noexcept -> const std::shared_ptr> & 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 -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 public: Window() noexcept = default; - [[nodiscard]] Bounds size() const noexcept override; + [[nodiscard]] auto size() const noexcept -> Bounds override; }; -- cgit v1.2.3-18-g5258