diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-09 17:10:32 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-09 17:10:32 +0200 |
commit | a5d218fd1a7e842b7ea4ac7809b0ba89856a5205 (patch) | |
tree | 77021d322f45a2b1d17bc79dc6189df1562ba2ea /examples/basic/src/enemy_creator.cpp | |
parent | 58762e6e029d71ed72b094ec2d5831b6cac4e27b (diff) |
docs: fix basic example code style
Diffstat (limited to 'examples/basic/src/enemy_creator.cpp')
-rw-r--r-- | examples/basic/src/enemy_creator.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/basic/src/enemy_creator.cpp b/examples/basic/src/enemy_creator.cpp index 820ce1b..fd8a809 100644 --- a/examples/basic/src/enemy_creator.cpp +++ b/examples/basic/src/enemy_creator.cpp @@ -1,19 +1,22 @@ #include "enemy_creator.hpp" +#include <utility> + + EnemyCreator::EnemyCreator( IEnemyFactory small_enemy_factory, IEnemyFactory big_enemy_factory ) noexcept - : _small_enemy_factory(small_enemy_factory), _big_enemy_factory(big_enemy_factory) + : _small_enemy_factory(std::move(std::move(small_enemy_factory))), _big_enemy_factory(std::move(std::move(big_enemy_factory))) { } -std::unique_ptr<IEnemy> EnemyCreator::create_small_enemy() noexcept +auto EnemyCreator::create_small_enemy() noexcept -> std::unique_ptr<IEnemy> { return _small_enemy_factory(); } -std::unique_ptr<IEnemy> EnemyCreator::create_big_enemy() noexcept +auto EnemyCreator::create_big_enemy() noexcept -> std::unique_ptr<IEnemy> { return _big_enemy_factory(); } |