diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-16 12:24:19 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-16 13:44:15 +0200 |
commit | 5e9a9fef6edb636b7e6babb743541a18f25bd67f (patch) | |
tree | 0ffef80b2781498a80a8ddcf6d20c9cede749239 /src | |
parent | d2932dbdcf1ee0e646be90d9ad631ced171e012b (diff) |
use Corrade::Utility::move
Diffstat (limited to 'src')
-rw-r--r-- | src/emplacer.hpp | 3 | ||||
-rw-r--r-- | src/world.hpp | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/emplacer.hpp b/src/emplacer.hpp index eca115e8..d132bd7b 100644 --- a/src/emplacer.hpp +++ b/src/emplacer.hpp @@ -1,5 +1,6 @@ #pragma once #include <type_traits> +#include <Corrade/Utility/Move.h> namespace floormat { @@ -9,7 +10,7 @@ class emplacer { using type = std::decay_t<decltype(std::declval<F>()())>; public: - explicit constexpr emplacer(F&& fun) noexcept : fun{std::forward<F>(fun)} {} + explicit constexpr emplacer(F&& fun) noexcept : fun{Utility::forward<F>(fun)} {} constexpr operator type() const noexcept { return fun(); } }; diff --git a/src/world.hpp b/src/world.hpp index 4871a62c..c176dbbe 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -7,6 +7,7 @@ #include <memory> #include <unordered_map> #include <tsl/robin_map.h> +#include <Corrade/Utility/Move.h> template<> struct std::hash<floormat::chunk_coords_> final { @@ -85,8 +86,8 @@ public: } std::shared_ptr<T> make_entity(object_id id, global_coords pos, Xs&&... xs) { - auto ret = std::shared_ptr<T>(new T{id, operator[](chunk_coords_{pos.chunk(), pos.z()}), std::forward<Xs>(xs)...}); - do_make_entity(std::static_pointer_cast<entity>(ret), pos, sorted); + auto ret = std::shared_ptr<T>(new T{id, operator[](chunk_coords_{pos.chunk(), pos.z()}), Utility::forward<Xs>(xs)...}); + do_make_entity(static_pointer_cast<entity>(ret), pos, sorted); return ret; } @@ -125,7 +126,7 @@ std::shared_ptr<T> world::find_entity(object_id id) { if (!(ptr->type() == entity_type_<T>::value)) [[unlikely]] throw_on_wrong_entity_type(id, ptr->type(), entity_type_<T>::value); - return std::static_pointer_cast<T>(std::move(ptr)); + return static_pointer_cast<T>(Utility::move(ptr)); } } |