diff options
-rw-r--r-- | anim-crop-tool/main.cpp | 8 | ||||
-rw-r--r-- | compat/exception.hpp | 2 | ||||
-rw-r--r-- | compat/format.hpp | 3 | ||||
-rw-r--r-- | editor/app.cpp | 11 | ||||
-rw-r--r-- | editor/events.cpp | 4 | ||||
-rw-r--r-- | entity/metadata.hpp | 9 | ||||
-rw-r--r-- | shaders/shader.hpp | 3 | ||||
-rw-r--r-- | src/emplacer.hpp | 3 | ||||
-rw-r--r-- | src/world.hpp | 7 |
9 files changed, 26 insertions, 24 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp index 57af2912..65045fd4 100644 --- a/anim-crop-tool/main.cpp +++ b/anim-crop-tool/main.cpp @@ -10,7 +10,6 @@ #include <cmath> #include <cstring> #include <algorithm> -#include <utility> #include <tuple> #include <Corrade/Containers/Pair.h> @@ -19,6 +18,7 @@ #include <Corrade/Utility/Arguments.h> #include <Corrade/Utility/DebugStl.h> +#include <Corrade/Utility/Move.h> #include <Corrade/Utility/Path.h> #include <opencv2/core/mat.hpp> @@ -75,7 +75,7 @@ static bool load_file(anim_group& group, options& opts, anim_atlas_& atlas, Stri Error{} << "error: failed to load" << filename << "as RGBA32 image"; return cv::Mat4b{}; } - return cv::Mat4b(std::move(mat)); + return cv::Mat4b(Utility::move(mat)); ); if (mat.empty()) @@ -119,7 +119,7 @@ static bool load_file(anim_group& group, options& opts, anim_atlas_& atlas, Stri const Vector2ui dest_size_ = { (unsigned)dest_size.width, (unsigned)dest_size.height }; group.frames.push_back({ground, atlas.offset(), dest_size_}); - atlas.add_entry({&group.frames.back(), std::move(resized)}); + atlas.add_entry({&group.frames.back(), Utility::move(resized)}); return true; } @@ -223,7 +223,7 @@ static std::tuple<options, Arguments, bool> parse_cmdline(int argc, const char* if (opts.output_dir.isEmpty()) opts.output_dir = opts.input_dir; - return { std::move(opts), std::move(args), true }; + return { Utility::move(opts), Utility::move(args), true }; } [[nodiscard]] static int usage(const Arguments& args) noexcept diff --git a/compat/exception.hpp b/compat/exception.hpp index c1315a3c..dd07e483 100644 --- a/compat/exception.hpp +++ b/compat/exception.hpp @@ -22,7 +22,7 @@ private: template<typename Fmt, typename... Ts> exception::exception(const Fmt& fmt, Ts&&... args) noexcept { - fmt::format_to(std::back_inserter(buf), fmt, std::forward<Ts>(args)...); + fmt::format_to(std::back_inserter(buf), fmt, Utility::forward<Ts>(args)...); buf.push_back('\0'); } diff --git a/compat/format.hpp b/compat/format.hpp index 6eaf10d8..45f8a9cb 100644 --- a/compat/format.hpp +++ b/compat/format.hpp @@ -3,6 +3,7 @@ #include <fmt/compile.h> #include <Corrade/Containers/StringView.h> #include <Corrade/Containers/String.h> +#include <Corrade/Utility/Move.h> namespace fmt { @@ -50,7 +51,7 @@ template<size_t N, typename Fmt, typename... Xs> size_t snformat(char(&buf)[N], Fmt&& fmt, Xs&&... args) { constexpr size_t n = N > 0 ? N - 1 : 0; - auto result = fmt::format_to_n(buf, n, std::forward<Fmt>(fmt), std::forward<Xs>(args)...); + auto result = fmt::format_to_n(buf, n, Utility::forward<Fmt>(fmt), std::forward<Xs>(args)...); const auto len = std::min(n, result.size); if constexpr(N > 0) buf[len] = '\0'; diff --git a/editor/app.cpp b/editor/app.cpp index 020f39dc..f2caeaef 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -10,16 +10,15 @@ #include <cerrno> #include <cstdlib> #include <cstring> -#include <array> -#include <utility> #include <algorithm> #include <Corrade/Containers/StringIterable.h> #include <Corrade/Utility/Arguments.h> +#include <Corrade/Utility/Move.h> namespace floormat { app::app(fm_settings&& opts) : - M{floormat_main::create(*this, std::move(opts))} + M{floormat_main::create(*this, Utility::move(opts))} { reset_world(); auto& w = M->world(); @@ -85,7 +84,7 @@ void app::reset_world(struct world&& w_) _character_id = 0; _render_all_z_levels = true; - auto& w = M->reset_world(std::move(w_)); + auto& w = M->reset_world(Utility::move(w_)); w.collect(true); ensure_player_character(w); update_cursor_tile(pixel); @@ -175,9 +174,9 @@ int app::run_from_argv(const int argc, const char* const* const argv) Pointer<floormat_main> ptr; { - app application{std::move(opts)}; + app application{Utility::move(opts)}; ret = application.exec(); - ptr = std::move(application.M); + ptr = Utility::move(application.M); (void)ptr; } loader_::destroy(); diff --git a/editor/events.cpp b/editor/events.cpp index 18e3a8f6..3aa4c022 100644 --- a/editor/events.cpp +++ b/editor/events.cpp @@ -4,9 +4,7 @@ #include "floormat/events.hpp" #include "src/world.hpp" #include "keys.hpp" - -#include <utility> - +#include <tuple> #include <Magnum/Platform/Sdl2Application.h> #include <Magnum/ImGuiIntegration/Context.hpp> diff --git a/entity/metadata.hpp b/entity/metadata.hpp index 2bb8d346..8ad006ac 100644 --- a/entity/metadata.hpp +++ b/entity/metadata.hpp @@ -5,8 +5,9 @@ #include "util.hpp" #include "concepts.hpp" #include "compat/defs.hpp" -#include <concepts> #include <type_traits> +#include <concepts> +#include <utility> #include <limits> #include <utility> #include <tuple> @@ -216,7 +217,7 @@ struct Entity final { struct field final : entity_field<Obj, Type, R, W, Ts...> { constexpr field(StringView field_name, R r, W w, Ts&&... ts) noexcept : - entity_field<Obj, Type, R, W, Ts...>{field_name, r, w, std::forward<Ts>(ts)...} + entity_field<Obj, Type, R, W, Ts...>{field_name, r, w, Utility::forward<Ts>(ts)...} {} }; @@ -230,7 +231,7 @@ constexpr void visit_tuple(F&& fun, Tuple&& tuple) { using Size = std::tuple_size<std::decay_t<Tuple>>; if constexpr(Size() > 0) - detail::visit_tuple<F, Tuple, 0>(std::forward<F>(fun), std::forward<Tuple>(tuple)); + detail::visit_tuple<F, Tuple, 0>(Utility::forward<F>(fun), Utility::forward<Tuple>(tuple)); } template<typename F, typename Tuple> @@ -238,7 +239,7 @@ constexpr bool find_in_tuple(F&& fun, Tuple&& tuple) { using Size = std::tuple_size<std::decay_t<Tuple>>; if constexpr(Size() > 0) - return detail::find_in_tuple<F, Tuple, 0>(std::forward<F>(fun), std::forward<Tuple>(tuple)); + return detail::find_in_tuple<F, Tuple, 0>(Utility::forward<F>(fun), Utility::forward<Tuple>(tuple)); else return false; } diff --git a/shaders/shader.hpp b/shaders/shader.hpp index a8f778da..00bac08e 100644 --- a/shaders/shader.hpp +++ b/shaders/shader.hpp @@ -1,6 +1,7 @@ #pragma once #include "compat/defs.hpp" #include "tile-defs.hpp" +#include <Corrade/Utility/Move.h> #include <Magnum/GL/AbstractShaderProgram.h> #include <Magnum/Math/Vector2.h> #include <Magnum/Math/Vector3.h> @@ -60,7 +61,7 @@ template<typename T, typename... Xs> decltype(auto) tile_shader::draw(T&& mesh, Xs&&... xs) { _draw(); - return GL::AbstractShaderProgram::draw(std::forward<T>(mesh), std::forward<Xs>(xs)...); + return GL::AbstractShaderProgram::draw(Utility::forward<T>(mesh), Utility::forward<Xs>(xs)...); } template<typename T> 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)); } } |