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/randomization/generator.cpp | 4 ++-- src/randomization/generator.hpp | 4 ++-- src/randomization/seed_generator.cpp | 2 +- src/randomization/seed_generator.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/randomization') diff --git a/src/randomization/generator.cpp b/src/randomization/generator.cpp index 6956eda..2febf16 100644 --- a/src/randomization/generator.cpp +++ b/src/randomization/generator.cpp @@ -5,8 +5,8 @@ RandomNumberGenerator::RandomNumberGenerator(const uint32_t &seed) noexcept this->_generator = std::make_unique(seed); } -uint32_t RandomNumberGenerator::in_range(const uint32_t &a, - const uint32_t &b) const noexcept +auto RandomNumberGenerator::in_range(const uint32_t &a, + const uint32_t &b) const noexcept -> uint32_t { auto random_distribution = std::uniform_int_distribution(a, b); diff --git a/src/randomization/generator.hpp b/src/randomization/generator.hpp index 4b002dd..98acfde 100644 --- a/src/randomization/generator.hpp +++ b/src/randomization/generator.hpp @@ -10,8 +10,8 @@ class RandomNumberGenerator : public IRandomNumberGenerator public: explicit RandomNumberGenerator(const uint32_t &seed) noexcept; - [[nodiscard]] uint32_t in_range(const uint32_t &a, - const uint32_t &b) const noexcept override; + [[nodiscard]] auto in_range(const uint32_t &a, + const uint32_t &b) const noexcept -> uint32_t override; private: std::unique_ptr _generator; diff --git a/src/randomization/seed_generator.cpp b/src/randomization/seed_generator.cpp index 3afa275..5aedf17 100644 --- a/src/randomization/seed_generator.cpp +++ b/src/randomization/seed_generator.cpp @@ -6,7 +6,7 @@ SeedGenerator::SeedGenerator( { } -uint32_t SeedGenerator::random_seed() const noexcept +auto SeedGenerator::random_seed() const noexcept -> uint32_t { return (*_random_device)(); } diff --git a/src/randomization/seed_generator.hpp b/src/randomization/seed_generator.hpp index 087ad6b..2439949 100644 --- a/src/randomization/seed_generator.hpp +++ b/src/randomization/seed_generator.hpp @@ -11,7 +11,7 @@ public: explicit SeedGenerator( const std::shared_ptr &random_device) noexcept; - [[nodiscard]] uint32_t random_seed() const noexcept override; + [[nodiscard]] auto random_seed() const noexcept -> uint32_t override; private: const std::shared_ptr &_random_device; -- cgit v1.2.3-18-g5258