diff --git a/doc/generated/primitives.cpp b/doc/generated/primitives.cpp index a8c764239..7188d818c 100644 --- a/doc/generated/primitives.cpp +++ b/doc/generated/primitives.cpp @@ -431,7 +431,7 @@ Containers::Pair PrimitiveVisualizer::c Trade::MeshData capsule = Primitives::capsule2DWireframe(8, 1, 0.75f); MeshTools::transformPointsInPlace(Matrix3::scaling(Vector2{0.75f}), capsule.mutableAttribute(Trade::MeshAttribute::Position)); - return {std::move(capsule), "capsule2dwireframe.png"}; + return {Utility::move(capsule), "capsule2dwireframe.png"}; } Containers::Pair PrimitiveVisualizer::circle2DWireframe() { @@ -446,7 +446,7 @@ Containers::Pair PrimitiveVisualizer::l Trade::MeshData line = Primitives::line2D(); MeshTools::transformPointsInPlace(Matrix3::translation(Vector2::xAxis(-1.0f))*Matrix3::scaling(Vector2::xScale(2.0f)), line.mutableAttribute(Trade::MeshAttribute::Position)); - return {std::move(line), "line2d.png"}; + return {Utility::move(line), "line2d.png"}; } Containers::Pair PrimitiveVisualizer::squareWireframe() { @@ -457,7 +457,7 @@ Containers::Pair PrimitiveVisualizer::c Trade::MeshData capsule = Primitives::capsule3DWireframe(8, 1, 16, 1.0f); MeshTools::transformPointsInPlace(Matrix4::scaling(Vector3{0.75f}), capsule.mutableAttribute(Trade::MeshAttribute::Position)); - return {std::move(capsule), "capsule3dwireframe.png"}; + return {Utility::move(capsule), "capsule3dwireframe.png"}; } Containers::Pair PrimitiveVisualizer::circle3DWireframe() { @@ -492,7 +492,7 @@ Containers::Pair PrimitiveVisualizer::l Trade::MeshData line = Primitives::line3D(); MeshTools::transformPointsInPlace(Matrix4::translation(Vector3::xAxis(-1.0f))*Matrix4::scaling(Vector3::xScale(2.0f)), line.mutableAttribute(Trade::MeshAttribute::Position)); - return {std::move(line), "line3d.png"}; + return {Utility::move(line), "line3d.png"}; } Containers::Pair PrimitiveVisualizer::planeWireframe() { @@ -515,7 +515,7 @@ Containers::Pair PrimitiveVisualizer::c Trade::MeshData capsule = Primitives::capsule3DSolid(4, 1, 12, 0.75f); MeshTools::transformPointsInPlace(Matrix4::scaling(Vector3{0.75f}), capsule.mutableAttribute(Trade::MeshAttribute::Position)); - return {std::move(capsule), "capsule3dsolid.png"}; + return {Utility::move(capsule), "capsule3dsolid.png"}; } Containers::Pair PrimitiveVisualizer::circle3DSolid() { diff --git a/doc/generated/shaders.cpp b/doc/generated/shaders.cpp index 1ba283350..068d2da63 100644 --- a/doc/generated/shaders.cpp +++ b/doc/generated/shaders.cpp @@ -326,7 +326,7 @@ Containers::StringView ShaderVisualizer::vertexColor() { Trade::MeshData sphere = Primitives::uvSphereSolid(32, 64); /* Add a color attribute */ - Trade::MeshData sphereWithColors = MeshTools::interleave(std::move(sphere), { + Trade::MeshData sphereWithColors = MeshTools::interleave(Utility::move(sphere), { Trade::MeshAttributeData{Trade::MeshAttribute::Color, VertexFormat::Vector3, nullptr} }); diff --git a/src/Magnum/Animation/Test/PlayerTest.cpp b/src/Magnum/Animation/Test/PlayerTest.cpp index be59ff64d..9299722ac 100644 --- a/src/Magnum/Animation/Test/PlayerTest.cpp +++ b/src/Magnum/Animation/Test/PlayerTest.cpp @@ -281,7 +281,7 @@ void PlayerTest::constructMove() { CORRADE_COMPARE(a.track(0).keys().data(), Track.keys().data()); CORRADE_COMPARE(a.track(1).keys().data(), track2.keys().data()); - Player b{std::move(a)}; + Player b{Utility::move(a)}; CORRADE_COMPARE(b.duration(), (Range1D{0.5f, 4.0f})); CORRADE_COMPARE(b.playCount(), 37); CORRADE_COMPARE(b.state(), State::Playing); @@ -292,7 +292,7 @@ void PlayerTest::constructMove() { Player c; c.setDuration({1.2f, 1.3f}); - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.duration(), (Range1D{0.5f, 4.0f})); CORRADE_COMPARE(c.playCount(), 37); CORRADE_COMPARE(c.state(), State::Playing); diff --git a/src/Magnum/Animation/Track.h b/src/Magnum/Animation/Track.h index bd28e2839..c4ec39750 100644 --- a/src/Magnum/Animation/Track.h +++ b/src/Magnum/Animation/Track.h @@ -161,7 +161,7 @@ template>&&, Interpolation, Extrapolation, Extrapolation) * for an alternative. */ - explicit Track(Containers::Array>&& data, Interpolator interpolator, Extrapolation before, Extrapolation after) noexcept: _data{std::move(data)}, _interpolator{interpolator}, _interpolation{Interpolation::Custom}, _before{before}, _after{after} {} + explicit Track(Containers::Array>&& data, Interpolator interpolator, Extrapolation before, Extrapolation after) noexcept: _data{Utility::move(data)}, _interpolator{interpolator}, _interpolation{Interpolation::Custom}, _before{before}, _after{after} {} /** @overload */ explicit Track(std::initializer_list> data, Interpolator interpolator, Extrapolation before, Extrapolation after): Track{Containers::Array>{InPlaceInit, data}, interpolator, before, after} {} @@ -170,7 +170,7 @@ template>&&, Interpolator, Extrapolation, Extrapolation) * with both @p before and @p after set to @p extrapolation. */ - explicit Track(Containers::Array>&& data, Interpolator interpolator, Extrapolation extrapolation = Extrapolation::Constant) noexcept: Track{std::move(data), interpolator, extrapolation, extrapolation} {} + explicit Track(Containers::Array>&& data, Interpolator interpolator, Extrapolation extrapolation = Extrapolation::Constant) noexcept: Track{Utility::move(data), interpolator, extrapolation, extrapolation} {} /** @overload */ explicit Track(std::initializer_list> data, Interpolator interpolator, Extrapolation extrapolation = Extrapolation::Constant): Track{Containers::Array>{InPlaceInit, data}, interpolator, extrapolation, extrapolation} {} @@ -189,7 +189,7 @@ template>&& data, Interpolation interpolation, Interpolator interpolator, Extrapolation before, Extrapolation after) noexcept: _data{std::move(data)}, _interpolator{interpolator}, _interpolation{interpolation}, _before{before}, _after{after} {} + explicit Track(Containers::Array>&& data, Interpolation interpolation, Interpolator interpolator, Extrapolation before, Extrapolation after) noexcept: _data{Utility::move(data)}, _interpolator{interpolator}, _interpolation{interpolation}, _before{before}, _after{after} {} /** @overload */ explicit Track(std::initializer_list> data, Interpolation interpolation, Interpolator interpolator, Extrapolation before, Extrapolation after): Track{Containers::Array>{InPlaceInit, data}, interpolation, interpolator, before, after} {} @@ -198,7 +198,7 @@ template>&&, Interpolation, Interpolator, Extrapolation, Extrapolation) * with both @p before and @p after set to @p extrapolation. */ - explicit Track(Containers::Array>&& data, Interpolation interpolation, Interpolator interpolator, Extrapolation extrapolation = Extrapolation::Constant) noexcept: Track{std::move(data), interpolation, interpolator, extrapolation, extrapolation} {} + explicit Track(Containers::Array>&& data, Interpolation interpolation, Interpolator interpolator, Extrapolation extrapolation = Extrapolation::Constant) noexcept: Track{Utility::move(data), interpolation, interpolator, extrapolation, extrapolation} {} /** @overload */ explicit Track(std::initializer_list> data, Interpolation interpolation, Interpolator interpolator, Extrapolation extrapolation = Extrapolation::Constant): Track{Containers::Array>{InPlaceInit, data}, interpolation, interpolator, extrapolation} {} @@ -216,7 +216,7 @@ template>&& data, Interpolation interpolation, Extrapolation before, Extrapolation after) noexcept: _data{std::move(data)}, _interpolator{interpolatorFor(interpolation)}, _interpolation{interpolation}, _before{before}, _after{after} {} + explicit Track(Containers::Array>&& data, Interpolation interpolation, Extrapolation before, Extrapolation after) noexcept: _data{Utility::move(data)}, _interpolator{interpolatorFor(interpolation)}, _interpolation{interpolation}, _before{before}, _after{after} {} /** @overload */ explicit Track(std::initializer_list> data, Interpolation interpolation, Extrapolation before, Extrapolation after): Track{Containers::Array>{InPlaceInit, data}, interpolation, before, after} {} @@ -225,7 +225,7 @@ template>&&, Interpolation, Extrapolation, Extrapolation) * with both @p before and @p after set to @p extrapolation. */ - explicit Track(Containers::Array>&& data, Interpolation interpolation, Extrapolation extrapolation = Extrapolation::Constant) noexcept: Track{std::move(data), interpolation, extrapolation, extrapolation} {} + explicit Track(Containers::Array>&& data, Interpolation interpolation, Extrapolation extrapolation = Extrapolation::Constant) noexcept: Track{Utility::move(data), interpolation, extrapolation, extrapolation} {} /** @overload */ explicit Track(std::initializer_list> data, Interpolation interpolation, Extrapolation extrapolation = Extrapolation::Constant): Track{Containers::Array>{InPlaceInit, data}, interpolation, extrapolation, extrapolation} {} diff --git a/src/Magnum/Audio/Buffer.h b/src/Magnum/Audio/Buffer.h index 336de598e..d1813cd06 100644 --- a/src/Magnum/Audio/Buffer.h +++ b/src/Magnum/Audio/Buffer.h @@ -232,7 +232,7 @@ inline Buffer::Buffer(Buffer&& other): _id(other._id) { } inline Buffer& Buffer::operator=(Buffer&& other) { - using std::swap; + using Utility::swap; swap(_id, other._id); return *this; } diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 577271b10..566aa42b8 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -315,7 +315,7 @@ bool Context::tryCreate(const Configuration& configuration) { return true; } -Context::Context(Context&& other) noexcept: _device{other._device}, _context{other._context}, _extensionStatus{std::move(other._extensionStatus)}, _supportedExtensions{std::move(other._supportedExtensions)} { +Context::Context(Context&& other) noexcept: _device{other._device}, _context{other._context}, _extensionStatus{Utility::move(other._extensionStatus)}, _supportedExtensions{Utility::move(other._supportedExtensions)} { other._device = nullptr; other._context = nullptr; if(currentContext == &other) currentContext = this; @@ -409,7 +409,7 @@ Context::Configuration& Context::Configuration::setDeviceSpecifier(const std::st } Context::Configuration& Context::Configuration::setDeviceSpecifier(std::string&& specifier) { - _deviceSpecifier = std::move(specifier); + _deviceSpecifier = Utility::move(specifier); return *this; } diff --git a/src/Magnum/Audio/Source.h b/src/Magnum/Audio/Source.h index c280b011d..14ed20383 100644 --- a/src/Magnum/Audio/Source.h +++ b/src/Magnum/Audio/Source.h @@ -35,6 +35,7 @@ #include #include +#include #include "Magnum/Magnum.h" #include "Magnum/Audio/Audio.h" @@ -779,7 +780,7 @@ inline Source::Source(Source&& other): _id(other._id) { } inline Source& Source::operator=(Source&& other) { - using std::swap; + using Utility::swap; swap(_id, other._id); return *this; } diff --git a/src/Magnum/Audio/Test/ContextALTest.cpp b/src/Magnum/Audio/Test/ContextALTest.cpp index f8ec8ee25..0201f9699 100644 --- a/src/Magnum/Audio/Test/ContextALTest.cpp +++ b/src/Magnum/Audio/Test/ContextALTest.cpp @@ -171,7 +171,7 @@ void ContextALTest::constructMove() { Int frequency = context.frequency(); { - Context second{std::move(context)}; + Context second{Utility::move(context)}; CORRADE_COMPARE(&Context::current(), &second); #ifdef CORRADE_TARGET_APPLE if(context.vendorString() == "Apple Computer Inc.") diff --git a/src/Magnum/DebugTools/CompareImage.cpp b/src/Magnum/DebugTools/CompareImage.cpp index ea5b65039..dc5bfa7f5 100644 --- a/src/Magnum/DebugTools/CompareImage.cpp +++ b/src/Magnum/DebugTools/CompareImage.cpp @@ -232,7 +232,7 @@ Containers::Triple, Float, Float> calculateImageDelta(c left that could cause the comparison to fail. */ const Float mean = Math::Algorithms::kahanSum(deltaData.begin(), deltaData.end())/deltaData.size(); - return {std::move(deltaData), max, mean}; + return {Utility::move(deltaData), max, mean}; } namespace { @@ -543,7 +543,7 @@ TestSuite::ComparisonStatusFlags ImageComparatorBase::compare(const PixelFormat } else return TestSuite::ComparisonStatusFlags{}; /* Otherwise save the deltas and fail */ - _state->delta = std::move(deltaMaxMean.first()); + _state->delta = Utility::move(deltaMaxMean.first()); return flags; } diff --git a/src/Magnum/DebugTools/FrameProfiler.cpp b/src/Magnum/DebugTools/FrameProfiler.cpp index b01e3188f..3a1ff1d7f 100644 --- a/src/Magnum/DebugTools/FrameProfiler.cpp +++ b/src/Magnum/DebugTools/FrameProfiler.cpp @@ -62,7 +62,7 @@ FrameProfiler::Measurement::Measurement(const Containers::StringView name, const FrameProfiler::FrameProfiler() noexcept = default; FrameProfiler::FrameProfiler(Containers::Array&& measurements, UnsignedInt maxFrameCount) noexcept { - setup(std::move(measurements), maxFrameCount); + setup(Utility::move(measurements), maxFrameCount); } FrameProfiler::FrameProfiler(const std::initializer_list measurements, const UnsignedInt maxFrameCount): FrameProfiler{Containers::array(measurements), maxFrameCount} {} @@ -74,8 +74,8 @@ FrameProfiler::FrameProfiler(FrameProfiler&& other) noexcept: #endif _maxFrameCount{other._maxFrameCount}, _measuredFrameCount{other._measuredFrameCount}, - _measurements{std::move(other._measurements)}, - _data{std::move(other._data)} + _measurements{Utility::move(other._measurements)}, + _data{Utility::move(other._data)} { /* For all state pointers that point to &other patch them to point to this instead, to account for 90% of use cases of derived classes */ @@ -84,7 +84,7 @@ FrameProfiler::FrameProfiler(FrameProfiler&& other) noexcept: } FrameProfiler& FrameProfiler::operator=(FrameProfiler&& other) noexcept { - using std::swap; + using Utility::swap; swap(_enabled, other._enabled); #ifndef CORRADE_NO_ASSERT swap(_beginFrameCalled, other._beginFrameCalled); @@ -111,7 +111,7 @@ void FrameProfiler::setup(Containers::Array&& measurements, const U CORRADE_ASSERT(maxFrameCount >= 1, "DebugTools::FrameProfiler::setup(): max frame count can't be zero", ); _maxFrameCount = maxFrameCount; - _measurements = std::move(measurements); + _measurements = Utility::move(measurements); arrayReserve(_data, maxFrameCount*_measurements.size()); #ifndef CORRADE_NO_ASSERT @@ -573,7 +573,7 @@ void FrameProfilerGL::setup(const Values values, const UnsignedInt maxFrameCount _state->primitiveClipRatioIndex = index++; } #endif - setup(std::move(measurements), maxFrameCount); + setup(Utility::move(measurements), maxFrameCount); } auto FrameProfilerGL::values() const -> Values { diff --git a/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp b/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp index 2185150ba..d3d217cf9 100644 --- a/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp +++ b/src/Magnum/DebugTools/Test/FrameProfilerTest.cpp @@ -698,7 +698,7 @@ void FrameProfilerTest::move() { }, 5); /* Move construction */ - MyProfiler b{std::move(a)}; + MyProfiler b{Utility::move(a)}; a.j = 100; /* This shouldn't affect b's measurements anymore */ b.beginFrame(); b.endFrame(); @@ -747,8 +747,8 @@ void FrameProfilerTest::move() { /* Move assignment */ CORRADE_COMPARE(c.j, 62); - c = std::move(b); - b.j = 62; /* std::move() didn't swap this one, so we do; this shouldn't + c = Utility::move(b); + b.j = 62; /* Utility::move() didn't swap this one, so we do; this shouldn't affect c's measurements anymore */ c.beginFrame(); c.endFrame(); @@ -1099,7 +1099,7 @@ void FrameProfilerTest::gl() { /* Test that we use the right state pointers to survive a move */ Containers::Pointer profiler_{InPlaceInit, data.values, 4u}; - FrameProfilerGL profiler = std::move(*profiler_); + FrameProfilerGL profiler = Utility::move(*profiler_); profiler_ = nullptr; CORRADE_COMPARE(profiler.values(), data.values); CORRADE_COMPARE(profiler.maxFrameCount(), 4); diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index 97c6c7103..9ab5f2ea7 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/src/Magnum/DebugTools/TextureImage.cpp @@ -165,7 +165,7 @@ void textureSubImage(GL::Texture2D& texture, const Int level, const Range2Di& ra }; GL::Buffer buffer{GL::Buffer::TargetHint::Array}; buffer.setData(triangle, GL::BufferUsage::StaticDraw); - mesh.addVertexBuffer(std::move(buffer), 0, GL::Attribute<0, Vector2>{}); + mesh.addVertexBuffer(Utility::move(buffer), 0, GL::Attribute<0, Vector2>{}); } shader.draw(mesh); @@ -186,7 +186,7 @@ void textureSubImage(GL::Texture2D& texture, const Int level, const Range2Di& ra Image2D textureSubImage(GL::Texture2D& texture, const Int level, const Range2Di& range, Image2D&& image) { textureSubImage(texture, level, range, image); - return std::move(image); + return Utility::move(image); } #ifndef MAGNUM_TARGET_GLES2 @@ -205,7 +205,7 @@ void textureSubImage(GL::Texture2D& texture, const Int level, const Range2Di& ra GL::BufferImage2D textureSubImage(GL::Texture2D& texture, const Int level, const Range2Di& range, GL::BufferImage2D&& image, const GL::BufferUsage usage) { textureSubImage(texture, level, range, image, usage); - return std::move(image); + return Utility::move(image); } #endif @@ -217,7 +217,7 @@ void textureSubImage(GL::CubeMapTexture& texture, const GL::CubeMapCoordinate co Image2D textureSubImage(GL::CubeMapTexture& texture, const GL::CubeMapCoordinate coordinate, const Int level, const Range2Di& range, Image2D&& image) { textureSubImage(texture, coordinate, level, range, image); - return std::move(image); + return Utility::move(image); } #ifndef MAGNUM_TARGET_GLES2 @@ -229,7 +229,7 @@ void textureSubImage(GL::CubeMapTexture& texture, const GL::CubeMapCoordinate co GL::BufferImage2D textureSubImage(GL::CubeMapTexture& texture, const GL::CubeMapCoordinate coordinate, const Int level, const Range2Di& range, GL::BufferImage2D&& image, const GL::BufferUsage usage) { textureSubImage(texture, coordinate, level, range, image, usage); - return std::move(image); + return Utility::move(image); } #endif diff --git a/src/Magnum/GL/AbstractFramebuffer.cpp b/src/Magnum/GL/AbstractFramebuffer.cpp index 5fc6e186c..7bff3b7b7 100644 --- a/src/Magnum/GL/AbstractFramebuffer.cpp +++ b/src/Magnum/GL/AbstractFramebuffer.cpp @@ -376,13 +376,13 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) { data = Containers::Array{dataSize}; /* Replace the storage, proxy to the function taking a view */ - image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), rectangle.size(), std::move(data), ImageFlags2D{}}; + image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), rectangle.size(), Utility::move(data), ImageFlags2D{}}; read(rectangle, MutableImageView2D(image)); } Image2D AbstractFramebuffer::read(const Range2Di& rectangle, Image2D&& image) { read(rectangle, image); - return std::move(image); + return Utility::move(image); } #ifndef MAGNUM_TARGET_GLES2 @@ -403,7 +403,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, BufferImage2D& image, BufferImage2D AbstractFramebuffer::read(const Range2Di& rectangle, BufferImage2D&& image, BufferUsage usage) { read(rectangle, image, usage); - return std::move(image); + return Utility::move(image); } #endif diff --git a/src/Magnum/GL/AbstractFramebuffer.h b/src/Magnum/GL/AbstractFramebuffer.h index 93b3f9f21..7a93d9311 100644 --- a/src/Magnum/GL/AbstractFramebuffer.h +++ b/src/Magnum/GL/AbstractFramebuffer.h @@ -29,8 +29,8 @@ * @brief Class @ref Magnum::GL::AbstractFramebuffer, enum @ref Magnum::GL::FramebufferClear, @ref Magnum::GL::FramebufferBlit, @ref Magnum::GL::FramebufferBlitFilter, @ref Magnum::GL::FramebufferTarget, enum set @ref Magnum::GL::FramebufferClearMask */ -#include /* std::swap() */ #include +#include #include "Magnum/GL/GL.h" #include "Magnum/GL/AbstractObject.h" @@ -764,7 +764,7 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer { } AbstractFramebuffer& operator=(const AbstractFramebuffer&) = delete; AbstractFramebuffer& operator=(AbstractFramebuffer&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); swap(_viewport, other._viewport); swap(_flags, other._flags); diff --git a/src/Magnum/GL/AbstractQuery.h b/src/Magnum/GL/AbstractQuery.h index 879bad389..dede0aaaf 100644 --- a/src/Magnum/GL/AbstractQuery.h +++ b/src/Magnum/GL/AbstractQuery.h @@ -29,8 +29,8 @@ * @brief Class @ref Magnum::GL::AbstractQuery */ -#include /* std::swap() */ #include +#include #include "Magnum/Tags.h" #include "Magnum/GL/AbstractObject.h" @@ -205,7 +205,7 @@ inline AbstractQuery::AbstractQuery(AbstractQuery&& other) noexcept: _id(other._ } inline AbstractQuery& AbstractQuery::operator=(AbstractQuery&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); swap(_target, other._target); swap(_flags, other._flags); diff --git a/src/Magnum/GL/AbstractShaderProgram.cpp b/src/Magnum/GL/AbstractShaderProgram.cpp index dbdc0701d..c669c4366 100644 --- a/src/Magnum/GL/AbstractShaderProgram.cpp +++ b/src/Magnum/GL/AbstractShaderProgram.cpp @@ -316,7 +316,7 @@ AbstractShaderProgram::~AbstractShaderProgram() { } AbstractShaderProgram& AbstractShaderProgram::operator=(AbstractShaderProgram&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); return *this; } @@ -360,7 +360,7 @@ Containers::Pair AbstractShaderProgram::validate() { compile() message trimming it doesn't make sense to add driver-specific workarounds for this, so just trim it always. */ /** @todo this allocates a new string, revisit once String is capable of - trimming in-place, e.g. `std::move(message).trimmed()` would just + trimming in-place, e.g. `Utility::move(message).trimmed()` would just shift the data around */ return {bool(success), message.trimmed()}; } diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp index 4fbb80a80..90d0ef6ff 100644 --- a/src/Magnum/GL/AbstractTexture.cpp +++ b/src/Magnum/GL/AbstractTexture.cpp @@ -1742,7 +1742,7 @@ template void AbstractTexture::image(const GLint level, Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); Context::current().state().texture.getImageImplementation(*this, level, pixelFormat(image.format()), pixelType(image.format(), image.formatExtra()), data.size(), data); - image = Image{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, std::move(data), flags}; + image = Image{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, Utility::move(data), flags}; } template void MAGNUM_GL_EXPORT AbstractTexture::image<1>(GLint, Image<1>&, ImageFlags1D); @@ -1810,7 +1810,7 @@ template void AbstractTexture::compressedImage(const GLi Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); Context::current().state().texture.getCompressedImageImplementation(*this, level, data.size(), data); - image = CompressedImage{image.storage(), CompressedPixelFormat(format), size, std::move(data), flags}; + image = CompressedImage{image.storage(), CompressedPixelFormat(format), size, Utility::move(data), flags}; } template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedImage<1>&, ImageFlags1D); @@ -1894,7 +1894,7 @@ template void AbstractTexture::subImage(const GLint leve if(data.size() < dataSize) data = Containers::Array{dataSize}; - image = Image{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, std::move(data), flags}; + image = Image{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, Utility::move(data), flags}; subImage(level, range, BasicMutableImageView(image)); } @@ -1985,7 +1985,7 @@ template void AbstractTexture::compressedSubImage(const Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); glGetCompressedTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), data.size(), data); - image = CompressedImage{CompressedPixelFormat(format), size, std::move(data), flags}; + image = CompressedImage{CompressedPixelFormat(format), size, Utility::move(data), flags}; } template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedImage<1>&, ImageFlags1D); diff --git a/src/Magnum/GL/AbstractTexture.h b/src/Magnum/GL/AbstractTexture.h index d1acc61e3..3b30a4076 100644 --- a/src/Magnum/GL/AbstractTexture.h +++ b/src/Magnum/GL/AbstractTexture.h @@ -29,7 +29,8 @@ * @brief Class @ref Magnum::GL::AbstractTexture */ -#include /* std::swap() */ +#include +#include #include "Magnum/DimensionTraits.h" #include "Magnum/ImageFlags.h" @@ -815,7 +816,7 @@ inline AbstractTexture::AbstractTexture(AbstractTexture&& other) noexcept: _targ } inline AbstractTexture& AbstractTexture::operator=(AbstractTexture&& other) noexcept { - using std::swap; + using Utility::swap; swap(_target, other._target); swap(_id, other._id); swap(_flags, other._flags); diff --git a/src/Magnum/GL/Buffer.h b/src/Magnum/GL/Buffer.h index 1174abafc..c433232c8 100644 --- a/src/Magnum/GL/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -32,10 +32,10 @@ */ #include -#include /* std::swap() */ #include #include #include +#include #include "Magnum/Tags.h" #include "Magnum/GL/AbstractObject.h" @@ -1489,7 +1489,7 @@ inline Buffer::Buffer(Buffer&& other) noexcept: _id{other._id}, _targetHint{othe } inline Buffer& Buffer::operator=(Buffer&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); swap(_targetHint, other._targetHint); swap(_flags, other._flags); diff --git a/src/Magnum/GL/BufferImage.cpp b/src/Magnum/GL/BufferImage.cpp index 2ffdfb944..d95323f52 100644 --- a/src/Magnum/GL/BufferImage.cpp +++ b/src/Magnum/GL/BufferImage.cpp @@ -37,11 +37,11 @@ template BufferImage::BufferImage(const Pixe template BufferImage::BufferImage(const PixelStorage storage, const Magnum::PixelFormat format, const VectorTypeFor& size, Containers::ArrayView const data, const BufferUsage usage): BufferImage{storage, GL::pixelFormat(format), GL::pixelType(format), size, data, usage} {} -template BufferImage::BufferImage(const PixelStorage storage, const PixelFormat format, const PixelType type, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: _storage{storage}, _format{format}, _type{type}, _size{size}, _buffer{std::move(buffer)}, _dataSize{dataSize} { +template BufferImage::BufferImage(const PixelStorage storage, const PixelFormat format, const PixelType type, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: _storage{storage}, _format{format}, _type{type}, _size{size}, _buffer{Utility::move(buffer)}, _dataSize{dataSize} { CORRADE_ASSERT(Magnum::Implementation::imageDataSize(*this) <= dataSize, "GL::BufferImage::BufferImage(): data too small, got" << dataSize << "but expected at least" << Magnum::Implementation::imageDataSize(*this) << "bytes", ); } -template BufferImage::BufferImage(const PixelStorage storage, const Magnum::PixelFormat format, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: BufferImage{storage, GL::pixelFormat(format), GL::pixelType(format), size, std::move(buffer), dataSize} {} +template BufferImage::BufferImage(const PixelStorage storage, const Magnum::PixelFormat format, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: BufferImage{storage, GL::pixelFormat(format), GL::pixelType(format), size, Utility::move(buffer), dataSize} {} template BufferImage::BufferImage(const PixelStorage storage, const PixelFormat format, const PixelType type): _storage{storage}, _format{format}, _type{type}, _buffer{Buffer::TargetHint::PixelPack}, _dataSize{0} {} @@ -49,12 +49,12 @@ template BufferImage::BufferImage(const Pixe template BufferImage::BufferImage(NoCreateT) noexcept: _format{PixelFormat::RGBA}, _type{PixelType::UnsignedByte}, _buffer{NoCreate}, _dataSize{} {} -template BufferImage::BufferImage(BufferImage&& other) noexcept: _storage{std::move(other._storage)}, _format{std::move(other._format)}, _type{std::move(other._type)}, _size{std::move(other._size)}, _buffer{std::move(other._buffer)}, _dataSize{std::move(other._dataSize)} { +template BufferImage::BufferImage(BufferImage&& other) noexcept: _storage{Utility::move(other._storage)}, _format{Utility::move(other._format)}, _type{Utility::move(other._type)}, _size{Utility::move(other._size)}, _buffer{Utility::move(other._buffer)}, _dataSize{Utility::move(other._dataSize)} { other._size = {}; } template BufferImage& BufferImage::operator=(BufferImage&& other) noexcept { - using std::swap; + using Utility::swap; swap(_storage, other._storage); swap(_format, other._format); swap(_type, other._type); @@ -96,21 +96,21 @@ template CompressedBufferImage::CompressedBu template CompressedBufferImage::CompressedBufferImage(const CompressedPixelStorage storage, const Magnum::CompressedPixelFormat format, const VectorTypeFor& size, const Containers::ArrayView data, const BufferUsage usage): CompressedBufferImage{storage, compressedPixelFormat(format), size, data, usage} {} -template CompressedBufferImage::CompressedBufferImage(const CompressedPixelStorage storage, const CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: _storage{storage}, _format{format}, _size{size}, _buffer{std::move(buffer)}, _dataSize{dataSize} {} +template CompressedBufferImage::CompressedBufferImage(const CompressedPixelStorage storage, const CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: _storage{storage}, _format{format}, _size{size}, _buffer{Utility::move(buffer)}, _dataSize{dataSize} {} -template CompressedBufferImage::CompressedBufferImage(const CompressedPixelStorage storage, const Magnum::CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: CompressedBufferImage{storage, compressedPixelFormat(format), size, std::move(buffer), dataSize} {} +template CompressedBufferImage::CompressedBufferImage(const CompressedPixelStorage storage, const Magnum::CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, const std::size_t dataSize) noexcept: CompressedBufferImage{storage, compressedPixelFormat(format), size, Utility::move(buffer), dataSize} {} template CompressedBufferImage::CompressedBufferImage(const CompressedPixelStorage storage): _storage{storage}, _format{}, _buffer{Buffer::TargetHint::PixelPack}, _dataSize{} {} template CompressedBufferImage::CompressedBufferImage(NoCreateT) noexcept: _format{}, _buffer{NoCreate}, _dataSize{} {} -template CompressedBufferImage::CompressedBufferImage(CompressedBufferImage&& other) noexcept: _storage{std::move(other._storage)}, _format{std::move(other._format)}, _size{std::move(other._size)}, _buffer{std::move(other._buffer)}, _dataSize{std::move(other._dataSize)} { +template CompressedBufferImage::CompressedBufferImage(CompressedBufferImage&& other) noexcept: _storage{Utility::move(other._storage)}, _format{Utility::move(other._format)}, _size{Utility::move(other._size)}, _buffer{Utility::move(other._buffer)}, _dataSize{Utility::move(other._dataSize)} { other._size = {}; other._dataSize = {}; } template CompressedBufferImage& CompressedBufferImage::operator=(CompressedBufferImage&& other) noexcept { - using std::swap; + using Utility::swap; swap(_storage, other._storage); swap(_format, other._format); swap(_size, other._size); @@ -139,13 +139,13 @@ template void CompressedBufferImage::setData template Buffer BufferImage::release() { _size = {}; _dataSize = {}; - return std::move(_buffer); + return Utility::move(_buffer); } template Buffer CompressedBufferImage::release() { _size = {}; _dataSize = {}; - return std::move(_buffer); + return Utility::move(_buffer); } #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/Magnum/GL/BufferImage.h b/src/Magnum/GL/BufferImage.h index 4173abd01..6d350ae31 100644 --- a/src/Magnum/GL/BufferImage.h +++ b/src/Magnum/GL/BufferImage.h @@ -174,7 +174,7 @@ template class BufferImage { * Equivalent to calling @ref BufferImage(PixelStorage, PixelFormat, PixelType, const VectorTypeFor&, Buffer&&, std::size_t) * with default-constructed @ref PixelStorage. */ - explicit BufferImage(PixelFormat format, PixelType type, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: BufferImage{{}, format, type, size, std::move(buffer), dataSize} {} + explicit BufferImage(PixelFormat format, PixelType type, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: BufferImage{{}, format, type, size, Utility::move(buffer), dataSize} {} /** * @brief Construct from existing buffer @@ -200,7 +200,7 @@ template class BufferImage { * Equivalent to calling @ref BufferImage(PixelStorage, Magnum::PixelFormat, const VectorTypeFor&, Buffer&&, std::size_t) * with default-constructed @ref PixelStorage. */ - explicit BufferImage(Magnum::PixelFormat format, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: BufferImage{{}, format, size, std::move(buffer), dataSize} {} + explicit BufferImage(Magnum::PixelFormat format, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: BufferImage{{}, format, size, Utility::move(buffer), dataSize} {} /** * @brief Construct an image placeholder @@ -524,7 +524,7 @@ template class CompressedBufferImage { * Equivalent to calling @ref CompressedBufferImage(CompressedPixelStorage, CompressedPixelFormat, const VectorTypeFor&, Buffer&&, std::size_t) * with default-constructed @ref CompressedPixelStorage. */ - explicit CompressedBufferImage(CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: CompressedBufferImage{{}, format, size, std::move(buffer), dataSize} {} + explicit CompressedBufferImage(CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: CompressedBufferImage{{}, format, size, Utility::move(buffer), dataSize} {} /** * @brief Construct from existing buffer @@ -550,7 +550,7 @@ template class CompressedBufferImage { * Equivalent to calling @ref CompressedBufferImage(CompressedPixelStorage, Magnum::CompressedPixelFormat, const VectorTypeFor&, Buffer&&, std::size_t) * with default-constructed @ref CompressedPixelStorage. */ - explicit CompressedBufferImage(Magnum::CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: CompressedBufferImage{{}, format, size, std::move(buffer), dataSize} {} + explicit CompressedBufferImage(Magnum::CompressedPixelFormat format, const VectorTypeFor& size, Buffer&& buffer, std::size_t dataSize) noexcept: CompressedBufferImage{{}, format, size, Utility::move(buffer), dataSize} {} /** * @brief Construct an image placeholder diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 396373858..4d81498ad 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -773,12 +773,12 @@ Context::Context(Context&& other) noexcept: _extensionStatus{other._extensionStatus}, _extensionRequiredVersion{other._extensionRequiredVersion}, #ifdef MAGNUM_BUILD_DEPRECATED - _supportedExtensions{std::move(other._supportedExtensions)}, + _supportedExtensions{Utility::move(other._supportedExtensions)}, #endif _state{other._state}, - _detectedDrivers{std::move(other._detectedDrivers)}, - _driverWorkarounds{std::move(other._driverWorkarounds)}, - _disabledExtensions{std::move(other._disabledExtensions)}, + _detectedDrivers{Utility::move(other._detectedDrivers)}, + _driverWorkarounds{Utility::move(other._driverWorkarounds)}, + _disabledExtensions{Utility::move(other._disabledExtensions)}, _configurationFlags{other._configurationFlags} { if(currentContext == &other) currentContext = this; @@ -1003,7 +1003,7 @@ bool Context::tryCreate(const Configuration& configuration) { } Containers::Pair> state = Implementation::State::allocate(*this, output); - _stateData = std::move(state.first()); + _stateData = Utility::move(state.first()); _state = &*state.second(); /* Print a list of used workarounds */ diff --git a/src/Magnum/GL/CubeMapTexture.cpp b/src/Magnum/GL/CubeMapTexture.cpp index ccd1ae7fc..51c2e426b 100644 --- a/src/Magnum/GL/CubeMapTexture.cpp +++ b/src/Magnum/GL/CubeMapTexture.cpp @@ -109,12 +109,12 @@ void CubeMapTexture::image(const Int level, Image3D& image) { Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); Context::current().state().texture.getCubeImage3DImplementation(*this, level, size, pixelFormat(image.format()), pixelType(image.format(), image.formatExtra()), data.size(), data, image.storage()); - image = Image3D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, std::move(data), ImageFlag3D::CubeMap}; + image = Image3D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, Utility::move(data), ImageFlag3D::CubeMap}; } Image3D CubeMapTexture::image(const Int level, Image3D&& image) { this->image(level, image); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::image(const Int level, const MutableImageView3D& image) { @@ -148,7 +148,7 @@ void CubeMapTexture::image(const Int level, BufferImage3D& image, const BufferUs BufferImage3D CubeMapTexture::image(const Int level, BufferImage3D&& image, const BufferUsage usage) { this->image(level, image, usage); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) { @@ -180,12 +180,12 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image) Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); Context::current().state().texture.getCompressedCubeImage3DImplementation(*this, level, size.xy(), dataOffsetSize.first, dataOffsetSize.second, data); - image = CompressedImage3D{image.storage(), CompressedPixelFormat(format), size, std::move(data), ImageFlag3D::CubeMap}; + image = CompressedImage3D{image.storage(), CompressedPixelFormat(format), size, Utility::move(data), ImageFlag3D::CubeMap}; } CompressedImage3D CubeMapTexture::compressedImage(const Int level, CompressedImage3D&& image) { compressedImage(level, image); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::compressedImage(const Int level, const MutableCompressedImageView3D& image) { @@ -259,7 +259,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i CompressedBufferImage3D CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D&& image, const BufferUsage usage) { compressedImage(level, image, usage); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, Image2D& image) { @@ -274,12 +274,12 @@ void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); Context::current().state().texture.getCubeImageImplementation(*this, coordinate, level, size, pixelFormat(image.format()), pixelType(image.format(), image.formatExtra()), data.size(), data); - image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, std::move(data), ImageFlags2D{}}; + image = Image2D{image.storage(), image.format(), image.formatExtra(), image.pixelSize(), size, Utility::move(data), ImageFlags2D{}}; } Image2D CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, Image2D&& image) { this->image(coordinate, level, image); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, const MutableImageView2D& image) { @@ -311,7 +311,7 @@ void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, BufferImage2D CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, BufferImage2D&& image, const BufferUsage usage) { this->image(coordinate, level, image, usage); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedImage2D& image) { @@ -339,12 +339,12 @@ void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const I Buffer::unbindInternal(Buffer::TargetHint::PixelPack); Context::current().state().renderer.applyPixelStoragePack(image.storage()); Context::current().state().texture.getCompressedCubeImageImplementation(*this, coordinate, level, size, data.size(), data); - image = CompressedImage2D{image.storage(), CompressedPixelFormat(format), size, std::move(data), ImageFlags2D{}}; + image = CompressedImage2D{image.storage(), CompressedPixelFormat(format), size, Utility::move(data), ImageFlags2D{}}; } CompressedImage2D CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedImage2D&& image) { compressedImage(coordinate, level, image); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, const MutableCompressedImageView2D& image) { @@ -412,17 +412,17 @@ void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const I CompressedBufferImage2D CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, CompressedBufferImage2D&& image, const BufferUsage usage) { compressedImage(coordinate, level, image, usage); - return std::move(image); + return Utility::move(image); } Image3D CubeMapTexture::subImage(const Int level, const Range3Di& range, Image3D&& image) { this->subImage(level, range, image); - return std::move(image); + return Utility::move(image); } BufferImage3D CubeMapTexture::subImage(const Int level, const Range3Di& range, BufferImage3D&& image, const BufferUsage usage) { this->subImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, CompressedImage3D& image) { @@ -453,12 +453,12 @@ void CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, /* Would be CubeMap if the whole image was queried, but then we'd have to query the size and compare, which is extra work. So it's Array instead. */ - image = CompressedImage3D{CompressedPixelFormat(format), range.size(), std::move(data), ImageFlag3D::Array}; + image = CompressedImage3D{CompressedPixelFormat(format), range.size(), Utility::move(data), ImageFlag3D::Array}; } CompressedImage3D CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, CompressedImage3D&& image) { compressedSubImage(level, range, image); - return std::move(image); + return Utility::move(image); } void CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, const MutableCompressedImageView3D& image) { @@ -526,7 +526,7 @@ void CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, CompressedBufferImage3D CubeMapTexture::compressedSubImage(const Int level, const Range3Di& range, CompressedBufferImage3D&& image, const BufferUsage usage) { compressedSubImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } #endif diff --git a/src/Magnum/GL/CubeMapTextureArray.cpp b/src/Magnum/GL/CubeMapTextureArray.cpp index 6be44e472..61692bc45 100644 --- a/src/Magnum/GL/CubeMapTextureArray.cpp +++ b/src/Magnum/GL/CubeMapTextureArray.cpp @@ -75,42 +75,42 @@ CubeMapTextureArray CubeMapTextureArray::view(CubeMapTexture& original, const Te #ifndef MAGNUM_TARGET_GLES Image3D CubeMapTextureArray::image(const Int level, Image3D&& image) { this->image(level, image); - return std::move(image); + return Utility::move(image); } BufferImage3D CubeMapTextureArray::image(const Int level, BufferImage3D&& image, const BufferUsage usage) { this->image(level, image, usage); - return std::move(image); + return Utility::move(image); } CompressedImage3D CubeMapTextureArray::compressedImage(const Int level, CompressedImage3D&& image) { compressedImage(level, image); - return std::move(image); + return Utility::move(image); } CompressedBufferImage3D CubeMapTextureArray::compressedImage(const Int level, CompressedBufferImage3D&& image, const BufferUsage usage) { compressedImage(level, image, usage); - return std::move(image); + return Utility::move(image); } Image3D CubeMapTextureArray::subImage(const Int level, const Range3Di& range, Image3D&& image) { this->subImage(level, range, image); - return std::move(image); + return Utility::move(image); } BufferImage3D CubeMapTextureArray::subImage(const Int level, const Range3Di& range, BufferImage3D&& image, const BufferUsage usage) { this->subImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } CompressedImage3D CubeMapTextureArray::compressedSubImage(const Int level, const Range3Di& range, CompressedImage3D&& image) { compressedSubImage(level, range, image); - return std::move(image); + return Utility::move(image); } CompressedBufferImage3D CubeMapTextureArray::compressedSubImage(const Int level, const Range3Di& range, CompressedBufferImage3D&& image, const BufferUsage usage) { compressedSubImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } #endif diff --git a/src/Magnum/GL/Implementation/State.cpp b/src/Magnum/GL/Implementation/State.cpp index ade99550b..bacbba08d 100644 --- a/src/Magnum/GL/Implementation/State.cpp +++ b/src/Magnum/GL/Implementation/State.cpp @@ -170,7 +170,7 @@ Containers::Pair> State::al for(const char* extension: extensions) if(extension) Debug(out) << " " << extension; - return {std::move(data), state}; + return {Utility::move(data), state}; } }}} diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index 0d0ad32f2..a1745f516 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -289,15 +289,15 @@ Mesh::Mesh(Mesh&& other) noexcept: _id(other._id), _primitive(other._primitive), #ifndef MAGNUM_TARGET_GLES2 _indexStart(other._indexStart), _indexEnd(other._indexEnd), #endif - _indexBufferOffset(other._indexBufferOffset), _indexOffset(other._indexOffset), _indexType(other._indexType), _indexBuffer{std::move(other._indexBuffer)} + _indexBufferOffset(other._indexBufferOffset), _indexOffset(other._indexOffset), _indexType(other._indexType), _indexBuffer{Utility::move(other._indexBuffer)} { if(_constructed || other._constructed) - Context::current().state().mesh.moveConstructImplementation(*this, std::move(other)); + Context::current().state().mesh.moveConstructImplementation(*this, Utility::move(other)); other._id = 0; } Mesh& Mesh::operator=(Mesh&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); swap(_flags, other._flags); swap(_primitive, other._primitive); @@ -318,7 +318,7 @@ Mesh& Mesh::operator=(Mesh&& other) noexcept { swap(_indexBuffer, other._indexBuffer); if(_constructed || other._constructed) - Context::current().state().mesh.moveAssignImplementation(*this, std::move(other)); + Context::current().state().mesh.moveAssignImplementation(*this, Utility::move(other)); return *this; } @@ -406,7 +406,7 @@ Mesh& Mesh::setIndexBuffer(Buffer&& buffer, GLintptr offset, MeshIndexType type, tracker to _indexBuffer.id(). */ Context::current().state().mesh.bindIndexBufferImplementation(*this, buffer); - _indexBuffer = std::move(buffer); + _indexBuffer = Utility::move(buffer); _indexBufferOffset = offset; _indexType = type; #ifndef MAGNUM_TARGET_GLES2 @@ -1070,12 +1070,12 @@ void Mesh::createImplementationVAODSA(Mesh& self, const bool createObject) { #endif void Mesh::moveConstructImplementationDefault(Mesh& self, Mesh&& other) { - new(&self._attributes) std::vector{std::move(*reinterpret_cast*>(&other._attributes))}; + new(&self._attributes) std::vector{Utility::move(*reinterpret_cast*>(&other._attributes))}; self._constructed = true; } void Mesh::moveConstructImplementationVAO(Mesh& self, Mesh&& other) { - new(&self._attributes) std::vector{std::move(*reinterpret_cast*>(&other._attributes))}; + new(&self._attributes) std::vector{Utility::move(*reinterpret_cast*>(&other._attributes))}; self._constructed = true; } @@ -1087,27 +1087,27 @@ void Mesh::moveConstructImplementationVAO(Mesh& self, Mesh&& other) { void Mesh::moveAssignImplementationDefault(Mesh& self, Mesh&& other) { if(self._constructed && other._constructed) - std::swap(*reinterpret_cast*>(&self._attributes), + Utility::swap(*reinterpret_cast*>(&self._attributes), *reinterpret_cast*>(&other._attributes)); else if(self._constructed && !other._constructed) { other._constructed = true; - new(&other._attributes) std::vector{std::move(*reinterpret_cast*>(&self._attributes))}; + new(&other._attributes) std::vector{Utility::move(*reinterpret_cast*>(&self._attributes))}; } else if(!self._constructed && other._constructed) { self._constructed = true; - new(&self._attributes) std::vector{std::move(*reinterpret_cast*>(&other._attributes))}; + new(&self._attributes) std::vector{Utility::move(*reinterpret_cast*>(&other._attributes))}; } } void Mesh::moveAssignImplementationVAO(Mesh& self, Mesh&& other) { if(self._constructed && other._constructed) - std::swap(*reinterpret_cast*>(&self._attributes), + Utility::swap(*reinterpret_cast*>(&self._attributes), *reinterpret_cast*>(&other._attributes)); else if(self._constructed && !other._constructed) { other._constructed = true; - new(&other._attributes) std::vector{std::move(*reinterpret_cast*>(&self._attributes))}; + new(&other._attributes) std::vector{Utility::move(*reinterpret_cast*>(&self._attributes))}; } else if(!self._constructed && other._constructed) { self._constructed = true; - new(&self._attributes) std::vector{std::move(*reinterpret_cast*>(&other._attributes))}; + new(&self._attributes) std::vector{Utility::move(*reinterpret_cast*>(&other._attributes))}; } } @@ -1134,7 +1134,7 @@ void Mesh::attributePointerInternal(const Buffer& buffer, const GLuint location, void Mesh::attributePointerInternal(AttributeLayout&& attribute) { CORRADE_ASSERT(attribute.buffer.id(), "GL::Mesh::addVertexBuffer(): empty or moved-out Buffer instance was passed", ); - Context::current().state().mesh.attributePointerImplementation(*this, std::move(attribute)); + Context::current().state().mesh.attributePointerImplementation(*this, Utility::move(attribute)); } void Mesh::attributePointerImplementationDefault(Mesh& self, AttributeLayout&& attribute) { @@ -1143,7 +1143,7 @@ void Mesh::attributePointerImplementationDefault(Mesh& self, AttributeLayout&& a "GL::Mesh::addVertexBuffer(): the buffer has unexpected target hint, expected" << Buffer::TargetHint::Array << "but got" << attribute.buffer.targetHint(), ); #endif - reinterpret_cast*>(&self._attributes)->push_back(std::move(attribute)); + reinterpret_cast*>(&self._attributes)->push_back(Utility::move(attribute)); } void Mesh::attributePointerImplementationVAO(Mesh& self, AttributeLayout&& attribute) { @@ -1186,9 +1186,9 @@ void Mesh::attributePointerImplementationVAODSAIntelWindows(Mesh& self, Attribut /* See the "intel-windows-broken-dsa-integer-vertex-attributes" workaround for more information. */ if(attribute.kind == DynamicAttribute::Kind::Integral) - return attributePointerImplementationVAO(self, std::move(attribute)); + return attributePointerImplementationVAO(self, Utility::move(attribute)); else - return attributePointerImplementationVAODSA(self, std::move(attribute)); + return attributePointerImplementationVAODSA(self, Utility::move(attribute)); } #endif #endif @@ -1198,11 +1198,11 @@ void Mesh::attributePointerImplementationVAODSAIntelWindows(Mesh& self, Attribut these two */ void Mesh::attributePointerImplementationDefaultAngleAlwaysInstanced(Mesh& self, AttributeLayout&& attribute) { if(attribute.divisor) self._instanced = true; - return attributePointerImplementationDefault(self, std::move(attribute)); + return attributePointerImplementationDefault(self, Utility::move(attribute)); } void Mesh::attributePointerImplementationVAOAngleAlwaysInstanced(Mesh& self, AttributeLayout&& attribute) { if(attribute.divisor) self._instanced = true; - return attributePointerImplementationVAO(self, std::move(attribute)); + return attributePointerImplementationVAO(self, Utility::move(attribute)); } #endif @@ -1255,7 +1255,7 @@ void Mesh::vertexAttribDivisorImplementationNV(Mesh&, const GLuint index, const #endif void Mesh::acquireVertexBuffer(Buffer&& buffer) { - Context::current().state().mesh.acquireVertexBufferImplementation(*this, std::move(buffer)); + Context::current().state().mesh.acquireVertexBufferImplementation(*this, Utility::move(buffer)); } void Mesh::acquireVertexBufferImplementationDefault(Mesh& self, Buffer&& buffer) { @@ -1263,14 +1263,14 @@ void Mesh::acquireVertexBufferImplementationDefault(Mesh& self, Buffer&& buffer) auto& attributes = *reinterpret_cast*>(&self._attributes); CORRADE_INTERNAL_ASSERT(!attributes.empty() && attributes.back().buffer.id() == buffer.id() && buffer.id()); attributes.back().buffer.release(); /* so we swap back a zero ID */ - attributes.back().buffer = std::move(buffer); + attributes.back().buffer = Utility::move(buffer); } void Mesh::acquireVertexBufferImplementationVAO(Mesh& self, Buffer&& buffer) { CORRADE_INTERNAL_ASSERT(buffer.id()); /* With VAOs we are not maintaining the attribute list, so just store the buffer directly */ - reinterpret_cast*>(&self._attributes)->emplace_back(std::move(buffer)); + reinterpret_cast*>(&self._attributes)->emplace_back(Utility::move(buffer)); } void Mesh::bindIndexBufferImplementationDefault(Mesh&, Buffer&) {} diff --git a/src/Magnum/GL/Mesh.h b/src/Magnum/GL/Mesh.h index 870d3bfc3..43d897a16 100644 --- a/src/Magnum/GL/Mesh.h +++ b/src/Magnum/GL/Mesh.h @@ -998,7 +998,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { #endif > inline Mesh& addVertexBuffer(Buffer&& buffer, GLintptr offset, const T&... attributes) { addVertexBuffer(buffer, offset, attributes...); - acquireVertexBuffer(std::move(buffer)); + acquireVertexBuffer(Utility::move(buffer)); return *this; } @@ -1017,7 +1017,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { #endif > inline Mesh& addVertexBufferInstanced(Buffer&& buffer, UnsignedInt divisor, GLintptr offset, const T&... attributes) { addVertexBufferInstanced(buffer, divisor, offset, attributes...); - acquireVertexBuffer(std::move(buffer)); + acquireVertexBuffer(Utility::move(buffer)); return *this; } @@ -1031,7 +1031,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { */ Mesh& addVertexBuffer(Buffer&& buffer, GLintptr offset, GLsizei stride, const DynamicAttribute& attribute) { addVertexBuffer(buffer, offset, stride, attribute); - acquireVertexBuffer(std::move(buffer)); + acquireVertexBuffer(Utility::move(buffer)); return *this; } @@ -1045,7 +1045,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { */ Mesh& addVertexBufferInstanced(Buffer&& buffer, UnsignedInt divisor, GLintptr offset, GLsizei stride, const DynamicAttribute& attribute) { addVertexBufferInstanced(buffer, divisor, offset, stride, attribute); - acquireVertexBuffer(std::move(buffer)); + acquireVertexBuffer(Utility::move(buffer)); return *this; } @@ -1130,7 +1130,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { * index type. */ Mesh& setIndexBuffer(Buffer&& buffer, GLintptr offset, Magnum::MeshIndexType type, UnsignedInt start, UnsignedInt end) { - return setIndexBuffer(std::move(buffer), offset, meshIndexType(type), start, end); + return setIndexBuffer(Utility::move(buffer), offset, meshIndexType(type), start, end); } /** @@ -1141,7 +1141,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { * @ref GL-Mesh-buffer-ownership for more information. */ Mesh& setIndexBuffer(Buffer&& buffer, GLintptr offset, MeshIndexType type) { - return setIndexBuffer(std::move(buffer), offset, type, 0, 0); + return setIndexBuffer(Utility::move(buffer), offset, type, 0, 0); } /** @overload @@ -1153,7 +1153,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { * index type. */ Mesh& setIndexBuffer(Buffer&& buffer, GLintptr offset, Magnum::MeshIndexType type) { - return setIndexBuffer(std::move(buffer), offset, meshIndexType(type), 0, 0); + return setIndexBuffer(Utility::move(buffer), offset, meshIndexType(type), 0, 0); } #ifdef MAGNUM_BUILD_DEPRECATED diff --git a/src/Magnum/GL/RectangleTexture.cpp b/src/Magnum/GL/RectangleTexture.cpp index 4e7aa98ae..a992f0bd1 100644 --- a/src/Magnum/GL/RectangleTexture.cpp +++ b/src/Magnum/GL/RectangleTexture.cpp @@ -65,42 +65,42 @@ RectangleTexture RectangleTexture::view(RectangleTexture& original, const Textur Image2D RectangleTexture::image(Image2D&& image) { this->image(image); - return std::move(image); + return Utility::move(image); } BufferImage2D RectangleTexture::image(BufferImage2D&& image, const BufferUsage usage) { this->image(image, usage); - return std::move(image); + return Utility::move(image); } CompressedImage2D RectangleTexture::compressedImage(CompressedImage2D&& image) { compressedImage(image); - return std::move(image); + return Utility::move(image); } CompressedBufferImage2D RectangleTexture::compressedImage(CompressedBufferImage2D&& image, const BufferUsage usage) { compressedImage(image, usage); - return std::move(image); + return Utility::move(image); } Image2D RectangleTexture::subImage(const Range2Di& range, Image2D&& image) { this->subImage(range, image); - return std::move(image); + return Utility::move(image); } BufferImage2D RectangleTexture::subImage(const Range2Di& range, BufferImage2D&& image, const BufferUsage usage) { this->subImage(range, image, usage); - return std::move(image); + return Utility::move(image); } CompressedImage2D RectangleTexture::compressedSubImage(const Range2Di& range, CompressedImage2D&& image) { compressedSubImage(range, image); - return std::move(image); + return Utility::move(image); } CompressedBufferImage2D RectangleTexture::compressedSubImage(const Range2Di& range, CompressedBufferImage2D&& image, const BufferUsage usage) { compressedSubImage(range, image, usage); - return std::move(image); + return Utility::move(image); } RectangleTexture& RectangleTexture::setLabel(Containers::StringView label) { diff --git a/src/Magnum/GL/Renderbuffer.h b/src/Magnum/GL/Renderbuffer.h index 9ef3e7f09..73aced395 100644 --- a/src/Magnum/GL/Renderbuffer.h +++ b/src/Magnum/GL/Renderbuffer.h @@ -29,7 +29,7 @@ * @brief Class @ref Magnum::GL::Renderbuffer */ -#include /* std::swap() */ +#include #include "Magnum/Tags.h" #include "Magnum/GL/AbstractObject.h" @@ -280,7 +280,7 @@ inline Renderbuffer::Renderbuffer(Renderbuffer&& other) noexcept: _id{other._id} } inline Renderbuffer& Renderbuffer::operator=(Renderbuffer&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); swap(_flags, other._flags); return *this; diff --git a/src/Magnum/GL/Shader.cpp b/src/Magnum/GL/Shader.cpp index c8b38c981..abfd27937 100644 --- a/src/Magnum/GL/Shader.cpp +++ b/src/Magnum/GL/Shader.cpp @@ -761,7 +761,7 @@ Shader::Shader(Shader&& other) noexcept: _type{other._type}, _id{other._id}, _fl _offsetLineByOneOnOldGlsl{other._flags}, #endif _fileIndexOffset{other._fileIndexOffset}, - _sources{std::move(other._sources)} + _sources{Utility::move(other._sources)} { other._id = 0; } @@ -774,7 +774,7 @@ Shader::~Shader() { } Shader& Shader::operator=(Shader&& other) noexcept { - using std::swap; + using Utility::swap; swap(_type, other._type); swap(_id, other._id); swap(_flags, other._flags); @@ -837,14 +837,14 @@ Shader& Shader::addSourceInternal(Containers::String&& source) { (_sources.size() + 1 - _fileIndexOffset)/2)); else arrayAppend(_sources, Containers::String::nullTerminatedGlobalView(""_s)); - Context::current().state().shader.addSourceImplementation(*this, std::move(source)); + Context::current().state().shader.addSourceImplementation(*this, Utility::move(source)); } return *this; } void Shader::addSourceImplementationDefault(Shader& self, Containers::String&& source) { - arrayAppend(self._sources, std::move(source)); + arrayAppend(self._sources, Utility::move(source)); } #if defined(CORRADE_TARGET_EMSCRIPTEN) && defined(__EMSCRIPTEN_PTHREADS__) @@ -856,14 +856,14 @@ void Shader::addSourceImplementationEmscriptenPthread(Shader& self, Containers:: if(!source.isSmall() && !source.deleter()) source = Containers::String{source}; for(char& c: source) if(c < 0) c = ' '; - arrayAppend(self._sources, std::move(source)); + arrayAppend(self._sources, Utility::move(source)); } #endif Shader& Shader::addFile(const Containers::StringView filename) { Containers::Optional string = Utility::Path::readString(filename); CORRADE_ASSERT(string, "GL::Shader::addFile(): can't read" << filename, *this); - addSource(*std::move(string)); + addSource(*Utility::move(string)); return *this; } diff --git a/src/Magnum/GL/Shader.h b/src/Magnum/GL/Shader.h index 0850dbc63..32735065b 100644 --- a/src/Magnum/GL/Shader.h +++ b/src/Magnum/GL/Shader.h @@ -717,7 +717,7 @@ class MAGNUM_GL_EXPORT Shader: public AbstractObject { StringView overload. Sigh, C++. */ template::value>::type> Shader& addSource(U&& source) { - return addSourceInternal(std::move(source)); + return addSourceInternal(Utility::move(source)); } #endif diff --git a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp index 084082e63..0634d6f39 100644 --- a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp @@ -82,7 +82,7 @@ void AbstractQueryGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - SampleQuery b(std::move(a)); + SampleQuery b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); @@ -93,7 +93,7 @@ void AbstractQueryGLTest::constructMove() { SampleQuery c{SampleQuery::Target::AnySamplesPassed}; #endif const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index df7629bd9..a2d6c70b4 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -251,14 +251,14 @@ void AbstractShaderProgramGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - DummyShader b(std::move(a)); + DummyShader b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); DummyShader c; const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); @@ -1340,9 +1340,9 @@ void AbstractShaderProgramGLTest::subclassDraw() { type should still be ShaderSubclassDraw& even after all these. */ ShaderSubclassDraw& out = shader .draw(mesh) - .draw(std::move(mesh)) + .draw(Utility::move(mesh)) .draw(meshView) - .draw(std::move(meshView)) + .draw(Utility::move(meshView)) .draw(mesh, counts, vertexOffsets, indexOffsets) #ifndef CORRADE_TARGET_32BIT .draw(mesh, counts, vertexOffsets, indexOffsetsLong) diff --git a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp index c7978b596..2665328f7 100644 --- a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp @@ -105,14 +105,14 @@ void AbstractTextureGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Texture2D b(std::move(a)); + Texture2D b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); Texture2D c; const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp index 8f94eddf0..efe76ada6 100644 --- a/src/Magnum/GL/Test/BufferGLTest.cpp +++ b/src/Magnum/GL/Test/BufferGLTest.cpp @@ -161,14 +161,14 @@ void BufferGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Buffer b(std::move(a)); + Buffer b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); Buffer c; const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Test/BufferImageGLTest.cpp b/src/Magnum/GL/Test/BufferImageGLTest.cpp index b3f6a2310..9d8855f87 100644 --- a/src/Magnum/GL/Test/BufferImageGLTest.cpp +++ b/src/Magnum/GL/Test/BufferImageGLTest.cpp @@ -206,7 +206,7 @@ void BufferImageGLTest::constructBuffer() { const UnsignedInt id = buffer.id(); BufferImage2D a{PixelStorage{}.setAlignment(1), - PixelFormat::Red, PixelType::UnsignedByte, {1, 3}, std::move(buffer), sizeof(data)}; + PixelFormat::Red, PixelType::UnsignedByte, {1, 3}, Utility::move(buffer), sizeof(data)}; #ifndef MAGNUM_TARGET_GLES const auto imageData = a.buffer().data(); @@ -236,7 +236,7 @@ void BufferImageGLTest::constructBufferGeneric() { const UnsignedInt id = buffer.id(); BufferImage2D a{PixelStorage{}.setAlignment(1), - Magnum::PixelFormat::R8Unorm, {1, 3}, std::move(buffer), sizeof(data)}; + Magnum::PixelFormat::R8Unorm, {1, 3}, Utility::move(buffer), sizeof(data)}; #ifndef MAGNUM_TARGET_GLES const auto imageData = a.buffer().data(); @@ -270,7 +270,7 @@ void BufferImageGLTest::constructBufferCompressed() { CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), #endif CompressedPixelFormat::RGBAS3tcDxt1, - {4, 4}, std::move(buffer), sizeof(data)}; + {4, 4}, Utility::move(buffer), sizeof(data)}; #ifndef MAGNUM_TARGET_GLES const auto imageData = a.buffer().data(); @@ -305,7 +305,7 @@ void BufferImageGLTest::constructBufferCompressedGeneric() { CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), #endif Magnum::CompressedPixelFormat::Bc1RGBAUnorm, - {4, 4}, std::move(buffer), sizeof(data)}; + {4, 4}, Utility::move(buffer), sizeof(data)}; #ifndef MAGNUM_TARGET_GLES const auto imageData = a.buffer().data(); @@ -367,7 +367,7 @@ void BufferImageGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - BufferImage2D b(std::move(a)); + BufferImage2D b(Utility::move(a)); CORRADE_COMPARE(a.buffer().id(), 0); CORRADE_COMPARE(a.size(), Vector2i()); @@ -383,7 +383,7 @@ void BufferImageGLTest::constructMove() { BufferImage2D c{PixelStorage{}.setAlignment(1), PixelFormat::RGBA, PixelType::UnsignedShort, {1, 2}, data2, BufferUsage::StaticDraw}; const Int cId = c.buffer().id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -410,7 +410,7 @@ void BufferImageGLTest::constructMoveCompressed() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - CompressedBufferImage2D b{std::move(a)}; + CompressedBufferImage2D b{Utility::move(a)}; CORRADE_COMPARE(a.buffer().id(), 0); CORRADE_COMPARE(a.size(), Vector2i()); @@ -431,7 +431,7 @@ void BufferImageGLTest::constructMoveCompressed() { #endif CompressedPixelFormat::RGBAS3tcDxt1, {8, 4}, data2, BufferUsage::StaticDraw}; const Int cId = c.buffer().id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); diff --git a/src/Magnum/GL/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp index 601491fa6..989716231 100644 --- a/src/Magnum/GL/Test/ContextGLTest.cpp +++ b/src/Magnum/GL/Test/ContextGLTest.cpp @@ -319,7 +319,7 @@ void ContextGLTest::constructMove() { /* Move and create. This should take into account all parameters passed from above and combine them with what arrived through Configuration. */ - Platform::GLContext b = std::move(a); + Platform::GLContext b = Utility::move(a); /* The context is still not created here either */ CORRADE_VERIFY(!Context::hasCurrent()); @@ -365,7 +365,7 @@ void ContextGLTest::constructMove() { /* Now move the created context and verify the remaining state gets transferred as well */ - Platform::GLContext c = std::move(b); + Platform::GLContext c = Utility::move(b); #ifndef MAGNUM_TARGET_GLES /* This is an internal undocumented API but shh */ CORRADE_COMPARE(c.isDriverWorkaroundDisabled("no-layout-qualifiers-on-old-glsl"), data.workaroundDisabled); diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index 76be50c6a..4ce7a2153 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -306,7 +306,7 @@ void ContextTest::configurationConstructMove() { #endif .addDisabledExtensions(); - Context::Configuration b = std::move(a); + Context::Configuration b = Utility::move(a); CORRADE_COMPARE(UnsignedLong(b.flags()), UnsignedLong(Context::Configuration::Flag::VerboseLog)); CORRADE_VERIFY(a.disabledWorkarounds().isEmpty()); CORRADE_VERIFY(a.disabledExtensions().isEmpty()); @@ -330,7 +330,7 @@ void ContextTest::configurationConstructMove() { #endif ; - c = std::move(b); + c = Utility::move(b); #ifndef MAGNUM_TARGET_WEBGL CORRADE_COMPARE(b.disabledWorkarounds().size(), 2); #endif diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index 3ceecd893..c3e38e30d 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -375,7 +375,7 @@ void FramebufferGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Framebuffer b(std::move(a)); + Framebuffer b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); @@ -383,7 +383,7 @@ void FramebufferGLTest::constructMove() { Framebuffer c({{128, 256}, {32, 16}}); const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index 1617b401b..71161a151 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -813,7 +813,7 @@ void MeshGLTest::constructMove() { } /* Move construct */ - Mesh b(std::move(a)); + Mesh b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); @@ -822,7 +822,7 @@ void MeshGLTest::constructMove() { Mesh c; c.addVertexBuffer(buffer2, 4, Attribute<1, Float>{}); const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -840,7 +840,7 @@ void MeshGLTest::constructMove() { /* Move assign to a NoCreate instance */ Mesh d{NoCreate}; - d = std::move(c); + d = Utility::move(c); CORRADE_COMPARE(c.id(), 0); CORRADE_COMPARE(d.id(), id); @@ -2318,7 +2318,7 @@ void MeshGLTest::addVertexBufferTransferOwnwership() { { Mesh mesh; - mesh.addVertexBuffer(std::move(buffer), 0, Attribute<0, Float>{}); + mesh.addVertexBuffer(Utility::move(buffer), 0, Attribute<0, Float>{}); CORRADE_VERIFY(!buffer.id()); CORRADE_VERIFY(glIsBuffer(id)); } @@ -2360,7 +2360,7 @@ void MeshGLTest::addVertexBufferInstancedTransferOwnwership() { { Mesh mesh; - mesh.addVertexBufferInstanced(std::move(buffer), 1, 0, Attribute<0, Float>{}); + mesh.addVertexBufferInstanced(Utility::move(buffer), 1, 0, Attribute<0, Float>{}); CORRADE_VERIFY(!buffer.id()); CORRADE_VERIFY(glIsBuffer(id)); } @@ -2390,7 +2390,7 @@ void MeshGLTest::addVertexBufferDynamicTransferOwnwership() { { Mesh mesh; - mesh.addVertexBuffer(std::move(buffer), 0, 4, DynamicAttribute{ + mesh.addVertexBuffer(Utility::move(buffer), 0, 4, DynamicAttribute{ DynamicAttribute::Kind::GenericNormalized, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Float}); @@ -2438,7 +2438,7 @@ void MeshGLTest::addVertexBufferInstancedDynamicTransferOwnwership() { { Mesh mesh; - mesh.addVertexBufferInstanced(std::move(buffer), 1, 0, 4, DynamicAttribute{ + mesh.addVertexBufferInstanced(Utility::move(buffer), 1, 0, 4, DynamicAttribute{ DynamicAttribute::Kind::GenericNormalized, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Float}); @@ -2645,7 +2645,7 @@ template void MeshGLTest::setIndexBufferTransferOwnership() { { Mesh mesh; - mesh.setIndexBuffer(std::move(buffer), 0, T::UnsignedShort); + mesh.setIndexBuffer(Utility::move(buffer), 0, T::UnsignedShort); CORRADE_VERIFY(!buffer.id()); CORRADE_VERIFY(glIsBuffer(id)); } @@ -2675,7 +2675,7 @@ template void MeshGLTest::setIndexBufferRangeTransferOwnership() { { Mesh mesh; - mesh.setIndexBuffer(std::move(buffer), 0, T::UnsignedShort, 0, 1); + mesh.setIndexBuffer(Utility::move(buffer), 0, T::UnsignedShort, 0, 1); CORRADE_VERIFY(!buffer.id()); CORRADE_VERIFY(glIsBuffer(id)); } diff --git a/src/Magnum/GL/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp index 6efec9c7b..4798a1e29 100644 --- a/src/Magnum/GL/Test/MeshTest.cpp +++ b/src/Magnum/GL/Test/MeshTest.cpp @@ -123,11 +123,11 @@ void MeshTest::constructMoveNoCreate() { Mesh a{NoCreate}; CORRADE_COMPARE(a.id(), 0); - Mesh b{std::move(a)}; + Mesh b{Utility::move(a)}; CORRADE_COMPARE(b.id(), 0); Mesh c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), 0); } diff --git a/src/Magnum/GL/Test/RenderbufferGLTest.cpp b/src/Magnum/GL/Test/RenderbufferGLTest.cpp index 93b853773..1a6732881 100644 --- a/src/Magnum/GL/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferGLTest.cpp @@ -102,14 +102,14 @@ void RenderbufferGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Renderbuffer b(std::move(a)); + Renderbuffer b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); Renderbuffer c; const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp index c6fac232f..0b6784c4f 100644 --- a/src/Magnum/GL/Test/ShaderGLTest.cpp +++ b/src/Magnum/GL/Test/ShaderGLTest.cpp @@ -157,7 +157,7 @@ void ShaderGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Shader b(std::move(a)); + Shader b(Utility::move(a)); CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); @@ -177,7 +177,7 @@ void ShaderGLTest::constructMove() { Shader c(Version::GLES200, Shader::Type::Vertex); #endif const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp index 569db82d1..6dbd3abf2 100644 --- a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp @@ -175,14 +175,14 @@ void TransformFeedbackGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - TransformFeedback b{std::move(a)}; + TransformFeedback b{Utility::move(a)}; CORRADE_COMPARE(a.id(), 0); CORRADE_COMPARE(b.id(), id); TransformFeedback c; const Int cId = c.id(); - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); diff --git a/src/Magnum/GL/Texture.cpp b/src/Magnum/GL/Texture.cpp index 1bb98abc9..48891073a 100644 --- a/src/Magnum/GL/Texture.cpp +++ b/src/Magnum/GL/Texture.cpp @@ -135,42 +135,42 @@ template<> template<> MAGNUM_GL_EXPORT Texture2D Texture2D::view(CubeMapTextureA #ifndef MAGNUM_TARGET_GLES template Image Texture::image(const Int level, Image&& image) { this->image(level, image); - return std::move(image); + return Utility::move(image); } template BufferImage Texture::image(const Int level, BufferImage&& image, const BufferUsage usage) { this->image(level, image, usage); - return std::move(image); + return Utility::move(image); } template CompressedImage Texture::compressedImage(const Int level, CompressedImage&& image) { compressedImage(level, image); - return std::move(image); + return Utility::move(image); } template CompressedBufferImage Texture::compressedImage(const Int level, CompressedBufferImage&& image, const BufferUsage usage) { compressedImage(level, image, usage); - return std::move(image); + return Utility::move(image); } template Image Texture::subImage(const Int level, const RangeTypeFor& range, Image&& image) { this->subImage(level, range, image); - return std::move(image); + return Utility::move(image); } template BufferImage Texture::subImage(const Int level, const RangeTypeFor& range, BufferImage&& image, const BufferUsage usage) { this->subImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } template CompressedImage Texture::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedImage&& image) { compressedSubImage(level, range, image); - return std::move(image); + return Utility::move(image); } template CompressedBufferImage Texture::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedBufferImage&& image, const BufferUsage usage) { compressedSubImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } #endif diff --git a/src/Magnum/GL/TextureArray.cpp b/src/Magnum/GL/TextureArray.cpp index 73356b698..db7e5e19f 100644 --- a/src/Magnum/GL/TextureArray.cpp +++ b/src/Magnum/GL/TextureArray.cpp @@ -114,42 +114,42 @@ template<> template<> MAGNUM_GL_EXPORT Texture2DArray Texture2DArray::view(CubeM #ifndef MAGNUM_TARGET_GLES template Image TextureArray::image(const Int level, Image&& image) { this->image(level, image); - return std::move(image); + return Utility::move(image); } template BufferImage TextureArray::image(const Int level, BufferImage&& image, const BufferUsage usage) { this->image(level, image, usage); - return std::move(image); + return Utility::move(image); } template CompressedImage TextureArray::compressedImage(const Int level, CompressedImage&& image) { compressedImage(level, image); - return std::move(image); + return Utility::move(image); } template CompressedBufferImage TextureArray::compressedImage(const Int level, CompressedBufferImage&& image, const BufferUsage usage) { compressedImage(level, image, usage); - return std::move(image); + return Utility::move(image); } template Image TextureArray::subImage(const Int level, const RangeTypeFor& range, Image&& image) { this->subImage(level, range, image); - return std::move(image); + return Utility::move(image); } template BufferImage TextureArray::subImage(const Int level, const RangeTypeFor& range, BufferImage&& image, const BufferUsage usage) { this->subImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } template CompressedImage TextureArray::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedImage&& image) { compressedSubImage(level, range, image); - return std::move(image); + return Utility::move(image); } template CompressedBufferImage TextureArray::compressedSubImage(const Int level, const RangeTypeFor& range, CompressedBufferImage&& image, const BufferUsage usage) { compressedSubImage(level, range, image, usage); - return std::move(image); + return Utility::move(image); } #endif diff --git a/src/Magnum/GL/TransformFeedback.h b/src/Magnum/GL/TransformFeedback.h index 899ebd390..db4a5cf71 100644 --- a/src/Magnum/GL/TransformFeedback.h +++ b/src/Magnum/GL/TransformFeedback.h @@ -32,7 +32,8 @@ */ #endif -#include /* std::swap() */ +#include +#include #include "Magnum/Tags.h" #include "Magnum/GL/AbstractObject.h" @@ -456,7 +457,7 @@ inline TransformFeedback::TransformFeedback(TransformFeedback&& other) noexcept: } inline TransformFeedback& TransformFeedback::operator=(TransformFeedback&& other) noexcept { - using std::swap; + using Utility::swap; swap(_id, other._id); swap(_flags, other._flags); return *this; diff --git a/src/Magnum/GL/Version.h b/src/Magnum/GL/Version.h index e375e5acd..ee57d5777 100644 --- a/src/Magnum/GL/Version.h +++ b/src/Magnum/GL/Version.h @@ -29,7 +29,7 @@ * @brief Enum @ref Magnum::GL::Version, function @ref Magnum::GL::version(), @ref Magnum::GL::isVersionES() */ -#include +#include /* std::pair */ #include "Magnum/Magnum.h" #include "Magnum/GL/visibility.h" diff --git a/src/Magnum/Image.cpp b/src/Magnum/Image.cpp index 608a26e74..b4b379e40 100644 --- a/src/Magnum/Image.cpp +++ b/src/Magnum/Image.cpp @@ -31,11 +31,11 @@ namespace Magnum { -template Image::Image(const PixelStorage storage, const PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, format, {}, pixelFormatSize(format), size, std::move(data), flags} {} +template Image::Image(const PixelStorage storage, const PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, format, {}, pixelFormatSize(format), size, Utility::move(data), flags} {} -template Image::Image(const PixelStorage storage, const UnsignedInt format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, pixelFormatWrap(format), formatExtra, pixelSize, size, std::move(data), flags} {} +template Image::Image(const PixelStorage storage, const UnsignedInt format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, pixelFormatWrap(format), formatExtra, pixelSize, size, Utility::move(data), flags} {} -template Image::Image(const PixelStorage storage, const PixelFormat format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: _storage{storage}, _format{format}, _formatExtra{formatExtra}, _pixelSize{pixelSize}, _flags{flags}, _size{size}, _data{std::move(data)} { +template Image::Image(const PixelStorage storage, const PixelFormat format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: _storage{storage}, _format{format}, _formatExtra{formatExtra}, _pixelSize{pixelSize}, _flags{flags}, _size{size}, _data{Utility::move(data)} { CORRADE_ASSERT(Implementation::imageDataSize(*this) <= _data.size(), "Image: data too small, got" << _data.size() << "but expected at least" << Implementation::imageDataSize(*this) << "bytes", ); #ifndef CORRADE_NO_ASSERT Implementation::checkImageFlagsForSize("Image:", flags, size); @@ -48,12 +48,12 @@ template Image::Image(const PixelStorage sto template Image::Image(const PixelStorage storage, const PixelFormat format, const UnsignedInt formatExtra, const UnsignedInt pixelSize) noexcept: _storage{storage}, _format{format}, _formatExtra{formatExtra}, _pixelSize{pixelSize}, _data{} {} -template Image::Image(Image&& other) noexcept: _storage{std::move(other._storage)}, _format{std::move(other._format)}, _formatExtra{std::move(other._formatExtra)}, _pixelSize{std::move(other._pixelSize)}, _flags{std::move(other._flags)}, _size{std::move(other._size)}, _data{std::move(other._data)} { +template Image::Image(Image&& other) noexcept: _storage{Utility::move(other._storage)}, _format{Utility::move(other._format)}, _formatExtra{Utility::move(other._formatExtra)}, _pixelSize{Utility::move(other._pixelSize)}, _flags{Utility::move(other._flags)}, _size{Utility::move(other._size)}, _data{Utility::move(other._data)} { other._size = {}; } template Image& Image::operator=(Image&& other) noexcept { - using std::swap; + using Utility::swap; swap(_storage, other._storage); swap(_format, other._format); swap(_formatExtra, other._formatExtra); @@ -85,28 +85,28 @@ template Containers::StridedArrayView Containers::Array Image::release() { - Containers::Array data{std::move(_data)}; + Containers::Array data{Utility::move(_data)}; _size = {}; return data; } -template CompressedImage::CompressedImage(const CompressedPixelStorage storage, const CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: _storage{storage}, _format{format}, _flags{flags}, _size{size}, _data{std::move(data)} { +template CompressedImage::CompressedImage(const CompressedPixelStorage storage, const CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: _storage{storage}, _format{format}, _flags{flags}, _size{size}, _data{Utility::move(data)} { #ifndef CORRADE_NO_ASSERT Implementation::checkImageFlagsForSize("CompressedImage:", flags, size); #endif } -template CompressedImage::CompressedImage(const CompressedPixelStorage storage, const UnsignedInt format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: CompressedImage{storage, compressedPixelFormatWrap(format), size, std::move(data), flags} {} +template CompressedImage::CompressedImage(const CompressedPixelStorage storage, const UnsignedInt format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: CompressedImage{storage, compressedPixelFormatWrap(format), size, Utility::move(data), flags} {} template CompressedImage::CompressedImage(const CompressedPixelStorage storage) noexcept: _storage{storage}, _format{} {} -template CompressedImage::CompressedImage(CompressedImage&& other) noexcept: _storage{std::move(other._storage)}, _format{std::move(other._format)}, _flags{other._flags}, _size{std::move(other._size)}, _data{std::move(other._data)} +template CompressedImage::CompressedImage(CompressedImage&& other) noexcept: _storage{Utility::move(other._storage)}, _format{Utility::move(other._format)}, _flags{other._flags}, _size{Utility::move(other._size)}, _data{Utility::move(other._data)} { other._size = {}; } template CompressedImage& CompressedImage::operator=(CompressedImage&& other) noexcept { - using std::swap; + using Utility::swap; swap(_storage, other._storage); swap(_format, other._format); swap(_flags, other._flags); @@ -128,7 +128,7 @@ template std::pair Containers::Array CompressedImage::release() { - Containers::Array data{std::move(_data)}; + Containers::Array data{Utility::move(_data)}; _size = {}; return data; } diff --git a/src/Magnum/Image.h b/src/Magnum/Image.h index 6c0f5727d..4d014b6ac 100644 --- a/src/Magnum/Image.h +++ b/src/Magnum/Image.h @@ -153,7 +153,7 @@ template class Image { * Equivalent to calling @ref Image(PixelStorage, PixelFormat, const VectorTypeFor&, Containers::Array&&, ImageFlags) * with default-constructed @ref PixelStorage. */ - explicit Image(PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: Image{{}, format, size, std::move(data), flags} {} + explicit Image(PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: Image{{}, format, size, Utility::move(data), flags} {} /** * @brief Construct an image placeholder @@ -276,7 +276,7 @@ template class Image { * Equivalent to calling @ref Image(PixelStorage, T, U, const VectorTypeFor&, Containers::Array&&, ImageFlags) * with default-constructed @ref PixelStorage. */ - template explicit Image(T format, U formatExtra, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: Image{{}, format, formatExtra, size, std::move(data), flags} {} + template explicit Image(T format, U formatExtra, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: Image{{}, format, formatExtra, size, Utility::move(data), flags} {} /** * @brief Construct an image with implementation-specific pixel format @@ -288,7 +288,7 @@ template class Image { * Equivalent to calling @ref Image(PixelStorage, T, const VectorTypeFor&, Containers::Array&&, ImageFlags) * with default-constructed @ref PixelStorage. */ - template explicit Image(T format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: Image{{}, format, size, std::move(data), flags} {} + template explicit Image(T format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: Image{{}, format, size, Utility::move(data), flags} {} /** * @brief Construct an image placeholder with implementation-specific pixel format @@ -588,7 +588,7 @@ template class CompressedImage { * Equivalent to calling @ref CompressedImage(CompressedPixelStorage, CompressedPixelFormat, const VectorTypeFor&, Containers::Array&&, ImageFlags) * with default-constructed @ref CompressedPixelStorage. */ - explicit CompressedImage(CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: CompressedImage{{}, format, size, std::move(data), flags} {} + explicit CompressedImage(CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: CompressedImage{{}, format, size, Utility::move(data), flags} {} /** * @brief Construct a compressed image with implementation-specific format @@ -616,7 +616,7 @@ template class CompressedImage { * Equivalent to calling @ref CompressedImage(CompressedPixelStorage, T, const VectorTypeFor&, Containers::Array&&, ImageFlags) * with default-constructed @ref CompressedPixelStorage. */ - template explicit CompressedImage(T format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: CompressedImage{{}, format, size, std::move(data), flags} {} + template explicit CompressedImage(T format, const VectorTypeFor& size, Containers::Array&& data, ImageFlags flags = {}) noexcept: CompressedImage{{}, format, size, Utility::move(data), flags} {} /** * @brief Construct an image placeholder @@ -771,12 +771,12 @@ typedef CompressedImage<2> CompressedImage2D; /** @brief Three-dimensional compressed image */ typedef CompressedImage<3> CompressedImage3D; -template template inline Image::Image(const PixelStorage storage, const T format, const U formatExtra, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, UnsignedInt(format), UnsignedInt(formatExtra), Implementation::pixelFormatSizeAdl(format, formatExtra), size, std::move(data), flags} { +template template inline Image::Image(const PixelStorage storage, const T format, const U formatExtra, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, UnsignedInt(format), UnsignedInt(formatExtra), Implementation::pixelFormatSizeAdl(format, formatExtra), size, Utility::move(data), flags} { static_assert(sizeof(T) <= 4 && sizeof(U) <= 4, "format types larger than 32bits are not supported"); } -template template inline Image::Image(const PixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, UnsignedInt(format), {}, Implementation::pixelFormatSizeAdl(format), size, std::move(data), flags} { +template template inline Image::Image(const PixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: Image{storage, UnsignedInt(format), {}, Implementation::pixelFormatSizeAdl(format), size, Utility::move(data), flags} { static_assert(sizeof(T) <= 4, "format types larger than 32bits are not supported"); } @@ -791,7 +791,7 @@ template template inline Image::Ima "format types larger than 32bits are not supported"); } -template template inline CompressedImage::CompressedImage(const CompressedPixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: CompressedImage{storage, UnsignedInt(format), size, std::move(data), flags} { +template template inline CompressedImage::CompressedImage(const CompressedPixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags) noexcept: CompressedImage{storage, UnsignedInt(format), size, Utility::move(data), flags} { static_assert(sizeof(T) <= 4, "format types larger than 32bits are not supported"); } diff --git a/src/Magnum/Implementation/ImageProperties.h b/src/Magnum/Implementation/ImageProperties.h index 1527590f4..f048c79d6 100644 --- a/src/Magnum/Implementation/ImageProperties.h +++ b/src/Magnum/Implementation/ImageProperties.h @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. */ -#include +#include /* std::pair */ #include #include "Magnum/Magnum.h" diff --git a/src/Magnum/MaterialTools/Copy.cpp b/src/Magnum/MaterialTools/Copy.cpp index 89d7ef453..a9197b51f 100644 --- a/src/Magnum/MaterialTools/Copy.cpp +++ b/src/Magnum/MaterialTools/Copy.cpp @@ -61,7 +61,7 @@ Trade::MaterialData copy(Trade::MaterialData&& material) { Utility::copy(material.layerData(), layers); } - return Trade::MaterialData{material.types(), std::move(attributes), std::move(layers), material.importerState()}; + return Trade::MaterialData{material.types(), Utility::move(attributes), Utility::move(layers), material.importerState()}; } }} diff --git a/src/Magnum/MaterialTools/Filter.cpp b/src/Magnum/MaterialTools/Filter.cpp index 6d6986bb3..54d6d760f 100644 --- a/src/Magnum/MaterialTools/Filter.cpp +++ b/src/Magnum/MaterialTools/Filter.cpp @@ -102,7 +102,7 @@ Trade::MaterialData filterAttributesLayersImplementation(const Trade::MaterialDa Containers::Array attributes{patchedInputAttributesToKeep.count()}; Utility::copyMasked(material.attributeData(), patchedInputAttributesToKeep, attributes); - return Trade::MaterialData{material.types() & typesToKeep, std::move(attributes), std::move(layers)}; + return Trade::MaterialData{material.types() & typesToKeep, Utility::move(attributes), Utility::move(layers)}; } } diff --git a/src/Magnum/MaterialTools/Merge.cpp b/src/Magnum/MaterialTools/Merge.cpp index da56bee1f..1379ed83e 100644 --- a/src/Magnum/MaterialTools/Merge.cpp +++ b/src/Magnum/MaterialTools/Merge.cpp @@ -114,7 +114,7 @@ Containers::Optional merge(const Trade::MaterialData& first CORRADE_INTERNAL_ASSERT(layer == layers.size()); - return Trade::MaterialData{first.types()|second.types(), std::move(attributes), std::move(layers)}; + return Trade::MaterialData{first.types()|second.types(), Utility::move(attributes), Utility::move(layers)}; } }} diff --git a/src/Magnum/MaterialTools/PhongToPbrMetallicRoughness.cpp b/src/Magnum/MaterialTools/PhongToPbrMetallicRoughness.cpp index ee3d0f902..baf94e234 100644 --- a/src/Magnum/MaterialTools/PhongToPbrMetallicRoughness.cpp +++ b/src/Magnum/MaterialTools/PhongToPbrMetallicRoughness.cpp @@ -146,7 +146,7 @@ Containers::Optional phongToPbrMetallicRoughness(const Trad correctly, so just unpack the Optional directly. */ return *CORRADE_INTERNAL_ASSERT_EXPRESSION(merge( filterAttributes(material, attributesToKeep, ~Trade::MaterialType::Phong), - Trade::MaterialData{Trade::MaterialType::PbrMetallicRoughness, std::move(attributes)})); + Trade::MaterialData{Trade::MaterialType::PbrMetallicRoughness, Utility::move(attributes)})); } }} diff --git a/src/Magnum/MaterialTools/Test/CopyTest.cpp b/src/Magnum/MaterialTools/Test/CopyTest.cpp index cda9361f9..d4b3af1a9 100644 --- a/src/Magnum/MaterialTools/Test/CopyTest.cpp +++ b/src/Magnum/MaterialTools/Test/CopyTest.cpp @@ -175,7 +175,7 @@ void CopyTest::rvalueOwnedAttributesLayers() { const void* originalAttributes = attributes.data(); const void* originalLayers = layers.data(); - Trade::MaterialData copy = MaterialTools::copy(Trade::MaterialData{Trade::MaterialType::PbrMetallicRoughness, std::move(attributes), std::move(layers), reinterpret_cast(0xdeadbeef)}); + Trade::MaterialData copy = MaterialTools::copy(Trade::MaterialData{Trade::MaterialType::PbrMetallicRoughness, Utility::move(attributes), Utility::move(layers), reinterpret_cast(0xdeadbeef)}); CORRADE_COMPARE(copy.types(), Trade::MaterialType::PbrMetallicRoughness); CORRADE_COMPARE(copy.importerState(), reinterpret_cast(0xdeadbeef)); @@ -201,7 +201,7 @@ void CopyTest::rvalueOwnedAttributesNoLayerData() { Containers::Array layers{InPlaceInit, {2, 3}}; const void* originalAttributes = attributes.data(); - Trade::MaterialData copy = MaterialTools::copy(Trade::MaterialData{Trade::MaterialType::PbrMetallicRoughness, std::move(attributes), reinterpret_cast(0xdeadbeef)}); + Trade::MaterialData copy = MaterialTools::copy(Trade::MaterialData{Trade::MaterialType::PbrMetallicRoughness, Utility::move(attributes), reinterpret_cast(0xdeadbeef)}); CORRADE_COMPARE(copy.types(), Trade::MaterialType::PbrMetallicRoughness); CORRADE_COMPARE(copy.importerState(), reinterpret_cast(0xdeadbeef)); diff --git a/src/Magnum/Math/Algorithms/GaussJordan.h b/src/Magnum/Math/Algorithms/GaussJordan.h index ebdc6d9cd..6e68785bd 100644 --- a/src/Magnum/Math/Algorithms/GaussJordan.h +++ b/src/Magnum/Math/Algorithms/GaussJordan.h @@ -62,7 +62,7 @@ template bool gaussJordanInPlaceTra rowMax = row2; /* Swap the rows */ - using std::swap; + using Corrade::Utility::swap; swap(a[row], a[rowMax]); swap(t[row], t[rowMax]); diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index ca4a6e057..a10206010 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -35,6 +35,7 @@ #include /* std::div() */ #include #include +#include #include #include "Magnum/visibility.h" @@ -350,7 +351,7 @@ template inline typename std::enable_if::value, std::pair inline std::pair, Vector> minmax(const Vector& a, const Vector& b) { - using std::swap; + using Corrade::Utility::swap; std::pair, Vector> out{a, b}; for(std::size_t i = 0; i != size; ++i) if(out.first[i] > out.second[i]) swap(out.first[i], out.second[i]); diff --git a/src/Magnum/Math/Test/IntersectionBenchmark.cpp b/src/Magnum/Math/Test/IntersectionBenchmark.cpp index 9a8a3906d..ad36d2c68 100644 --- a/src/Magnum/Math/Test/IntersectionBenchmark.cpp +++ b/src/Magnum/Math/Test/IntersectionBenchmark.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include "Magnum/Math/Angle.h" diff --git a/src/Magnum/MeshTools/Combine.cpp b/src/Magnum/MeshTools/Combine.cpp index 280748083..7138e775a 100644 --- a/src/Magnum/MeshTools/Combine.cpp +++ b/src/Magnum/MeshTools/Combine.cpp @@ -106,7 +106,7 @@ Trade::MeshData combineIndexedImplementation( /* Combine the index buffer in */ return Trade::MeshData{primitive, - std::move(indexData), Trade::MeshIndexData{indexDataI}, + Utility::move(indexData), Trade::MeshIndexData{indexDataI}, out.releaseVertexData(), out.releaseAttributeData(), vertexCount}; } diff --git a/src/Magnum/MeshTools/Compile.cpp b/src/Magnum/MeshTools/Compile.cpp index 0d867a8ef..abfa809f1 100644 --- a/src/Magnum/MeshTools/Compile.cpp +++ b/src/Magnum/MeshTools/Compile.cpp @@ -113,7 +113,7 @@ GL::Mesh compileInternal(const Trade::MeshData& meshData, GL::Buffer&& indices, /* For the first attribute move the buffer in, for all others use the reference */ - if(vertices.id()) mesh.addVertexBuffer(std::move(vertices), + if(vertices.id()) mesh.addVertexBuffer(Utility::move(vertices), meshData.attributeOffset(i) + offset, stride, attribute); else mesh.addVertexBuffer(verticesRef, meshData.attributeOffset(i) + offset, stride, attribute); @@ -244,7 +244,7 @@ GL::Mesh compileInternal(const Trade::MeshData& meshData, GL::Buffer&& indices, CORRADE_ASSERT(isMeshIndexTypeImplementationSpecific(meshData.indexType()) || Short(meshIndexTypeSize(meshData.indexType())) == meshData.indexStride(), "MeshTools::compile():" << meshData.indexType() << "with stride of" << meshData.indexStride() << "bytes isn't supported by OpenGL", GL::Mesh{}); - mesh.setIndexBuffer(std::move(indices), meshData.indexOffset(), meshData.indexType()) + mesh.setIndexBuffer(Utility::move(indices), meshData.indexOffset(), meshData.indexType()) .setCount(meshData.indexCount()); } else mesh.setCount(meshData.vertexCount()); @@ -261,13 +261,13 @@ GL::Mesh compileInternal(const Trade::MeshData& meshData, const CompileFlags fla GL::Buffer vertices{GL::Buffer::TargetHint::Array}; vertices.setData(meshData.vertexData()); - return compileInternal(meshData, std::move(indices), std::move(vertices), flags); + return compileInternal(meshData, Utility::move(indices), Utility::move(vertices), flags); } } GL::Mesh compile(const Trade::MeshData& mesh, GL::Buffer&& indices, GL::Buffer&& vertices) { - return compileInternal(mesh, std::move(indices), std::move(vertices), {}); + return compileInternal(mesh, Utility::move(indices), Utility::move(vertices), {}); } GL::Mesh compile(const Trade::MeshData& mesh, GL::Buffer& indices, GL::Buffer& vertices) { @@ -275,11 +275,11 @@ GL::Mesh compile(const Trade::MeshData& mesh, GL::Buffer& indices, GL::Buffer& v } GL::Mesh compile(const Trade::MeshData& mesh, GL::Buffer& indices, GL::Buffer&& vertices) { - return compileInternal(mesh, GL::Buffer::wrap(indices.id(), GL::Buffer::TargetHint::ElementArray), std::move(vertices), CompileFlag::NoWarnOnCustomAttributes); + return compileInternal(mesh, GL::Buffer::wrap(indices.id(), GL::Buffer::TargetHint::ElementArray), Utility::move(vertices), CompileFlag::NoWarnOnCustomAttributes); } GL::Mesh compile(const Trade::MeshData& mesh, GL::Buffer&& indices, GL::Buffer& vertices) { - return compileInternal(mesh, std::move(indices), GL::Buffer::wrap(vertices.id(), GL::Buffer::TargetHint::Array), CompileFlag::NoWarnOnCustomAttributes); + return compileInternal(mesh, Utility::move(indices), GL::Buffer::wrap(vertices.id(), GL::Buffer::TargetHint::Array), CompileFlag::NoWarnOnCustomAttributes); } GL::Mesh compile(const Trade::MeshData& mesh) { @@ -363,7 +363,7 @@ GL::Mesh compile(const Trade::MeshData2D& meshData) { Containers::Array data = interleave( meshData.positions(0), stride - sizeof(Shaders::Generic2D::Position::Type)); - mesh.addVertexBuffer(std::move(vertexBuffer), 0, + mesh.addVertexBuffer(Utility::move(vertexBuffer), 0, Shaders::Generic2D::Position(), stride - sizeof(Shaders::Generic2D::Position::Type)); @@ -404,7 +404,7 @@ GL::Mesh compile(const Trade::MeshData2D& meshData) { GL::Buffer indexBuffer{GL::Buffer::TargetHint::ElementArray}; indexBuffer.setData(indexData, GL::BufferUsage::StaticDraw); mesh.setCount(meshData.indices().size()) - .setIndexBuffer(std::move(indexBuffer), 0, indexType, indexStart, indexEnd); + .setIndexBuffer(Utility::move(indexBuffer), 0, indexType, indexStart, indexEnd); /* Else set vertex count */ } else mesh.setCount(meshData.positions(0).size()); @@ -504,7 +504,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { Containers::Array data = interleave( positions, stride - sizeof(Shaders::Generic3D::Position::Type)); - mesh.addVertexBuffer(std::move(vertexBuffer), 0, + mesh.addVertexBuffer(Utility::move(vertexBuffer), 0, Shaders::Generic3D::Position(), stride - sizeof(Shaders::Generic3D::Position::Type)); @@ -558,7 +558,7 @@ GL::Mesh compile(const Trade::MeshData3D& meshData, CompileFlags flags) { GL::Buffer indexBuffer{GL::Buffer::TargetHint::ElementArray}; indexBuffer.setData(indexData, GL::BufferUsage::StaticDraw); mesh.setCount(meshData.indices().size()) - .setIndexBuffer(std::move(indexBuffer), 0, indexType, indexStart, indexEnd); + .setIndexBuffer(Utility::move(indexBuffer), 0, indexType, indexStart, indexEnd); /* Else set vertex count */ } else mesh.setCount(positions.size()); diff --git a/src/Magnum/MeshTools/CompileLines.cpp b/src/Magnum/MeshTools/CompileLines.cpp index 4dc7205eb..42ed579d4 100644 --- a/src/Magnum/MeshTools/CompileLines.cpp +++ b/src/Magnum/MeshTools/CompileLines.cpp @@ -54,7 +54,7 @@ GL::Mesh compileLines(const Trade::MeshData& mesh) { /* Upload the buffers, bind the line-specific attributes manually */ GL::Buffer indices{GL::Buffer::TargetHint::ElementArray, mesh.indexData()}; GL::Buffer vertices{GL::Buffer::TargetHint::Array, mesh.vertexData()}; - GL::Mesh out = compile(mesh, std::move(indices), vertices); + GL::Mesh out = compile(mesh, Utility::move(indices), vertices); /* Warn about attributes that are conflicting with line-specific attributes and thus will get overwritten */ @@ -79,7 +79,7 @@ GL::Mesh compileLines(const Trade::MeshData& mesh) { mesh.attributeOffset(Implementation::LineMeshAttributeNextPosition), mesh.attributeStride(Implementation::LineMeshAttributeNextPosition), GL::DynamicAttribute{Shaders::LineGL3D::NextPosition{}, mesh.attributeFormat(Implementation::LineMeshAttributeNextPosition)}); - out.addVertexBuffer(std::move(vertices), + out.addVertexBuffer(Utility::move(vertices), mesh.attributeOffset(Implementation::LineMeshAttributeAnnotation), mesh.attributeStride(Implementation::LineMeshAttributeAnnotation), GL::DynamicAttribute{Shaders::LineGL3D::Annotation{}, mesh.attributeFormat(Implementation::LineMeshAttributeAnnotation)}); diff --git a/src/Magnum/MeshTools/CompressIndices.cpp b/src/Magnum/MeshTools/CompressIndices.cpp index 408593b1e..9f177815d 100644 --- a/src/Magnum/MeshTools/CompressIndices.cpp +++ b/src/Magnum/MeshTools/CompressIndices.cpp @@ -81,7 +81,7 @@ template Containers::Pair, MeshIndexType> compr type = MeshIndexType::UnsignedInt; } - return {std::move(out), type}; + return {Utility::move(out), type}; } } @@ -171,8 +171,8 @@ Trade::MeshData compressIndices(Trade::MeshData&& mesh, MeshIndexType atLeast) { } Trade::MeshIndexData indices{result.second(), result.first()}; - return Trade::MeshData{mesh.primitive(), std::move(result.first()), indices, - std::move(vertexData), std::move(attributeData), newVertexCount}; + return Trade::MeshData{mesh.primitive(), Utility::move(result.first()), indices, + Utility::move(vertexData), Utility::move(attributeData), newVertexCount}; } Trade::MeshData compressIndices(const Trade::MeshData& mesh, MeshIndexType atLeast) { @@ -185,7 +185,7 @@ Trade::MeshData compressIndices(const Trade::MeshData& mesh, MeshIndexType atLea std::tuple, MeshIndexType, UnsignedInt, UnsignedInt> compressIndices(const std::vector& indices) { const auto minmax = Math::minmax(indices); Containers::Pair, MeshIndexType> dataType = compressIndices(indices, MeshIndexType::UnsignedByte); - return std::make_tuple(std::move(dataType.first()), dataType.second(), minmax.first, minmax.second); + return std::make_tuple(Utility::move(dataType.first()), dataType.second(), minmax.first, minmax.second); } template Containers::Array compressIndicesAs(const std::vector& indices) { diff --git a/src/Magnum/MeshTools/Concatenate.cpp b/src/Magnum/MeshTools/Concatenate.cpp index f748e8748..fc608cb18 100644 --- a/src/Magnum/MeshTools/Concatenate.cpp +++ b/src/Magnum/MeshTools/Concatenate.cpp @@ -82,9 +82,9 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI Trade::MeshData out{meshes.front().primitive(), /* If the index array is empty, we're creating a non-indexed mesh (not an indexed mesh with zero indices) */ - std::move(indexData), indices.isEmpty() ? + Utility::move(indexData), indices.isEmpty() ? Trade::MeshIndexData{} : Trade::MeshIndexData{indices}, - std::move(vertexData), std::move(attributeData), vertexCount}; + Utility::move(vertexData), Utility::move(attributeData), vertexCount}; /* Go through all meshes and put all attributes and index arrays together */ @@ -203,7 +203,7 @@ Trade::MeshData concatenate(const Containers::Iterable& m indexVertexCount.first()*sizeof(UnsignedInt)}; Containers::Array vertexData{ValueInit, attributeData.isEmpty() ? 0 : (attributeData[0].stride()*indexVertexCount.second())}; - return Implementation::concatenate(std::move(indexData), indexVertexCount.second(), std::move(vertexData), std::move(attributeData), meshes, "MeshTools::concatenate():"); + return Implementation::concatenate(Utility::move(indexData), indexVertexCount.second(), Utility::move(vertexData), Utility::move(attributeData), meshes, "MeshTools::concatenate():"); } }} diff --git a/src/Magnum/MeshTools/Concatenate.h b/src/Magnum/MeshTools/Concatenate.h index d5e6f6c98..df85607a0 100644 --- a/src/Magnum/MeshTools/Concatenate.h +++ b/src/Magnum/MeshTools/Concatenate.h @@ -125,7 +125,7 @@ template class Allocator = Containers::ArrayAllocator> void conc Containers::arrayResize(indexData, NoInit, indexVertexCount.first()*sizeof(UnsignedInt)); } - Containers::Array attributeData = Implementation::interleavedLayout(std::move(destination), {}, flags); + Containers::Array attributeData = Implementation::interleavedLayout(Utility::move(destination), {}, flags); Containers::Array vertexData; if(!attributeData.isEmpty() && indexVertexCount.second()) { const UnsignedInt attributeStride = attributeData[0].stride(); @@ -139,7 +139,7 @@ template class Allocator = Containers::ArrayAllocator> void conc Containers::arrayResize(vertexData, ValueInit, attributeStride*std::size_t(indexVertexCount.second())); } - destination = Implementation::concatenate(std::move(indexData), indexVertexCount.second(), std::move(vertexData), std::move(attributeData), meshes, "MeshTools::concatenateInto():"); + destination = Implementation::concatenate(Utility::move(indexData), indexVertexCount.second(), Utility::move(vertexData), Utility::move(attributeData), meshes, "MeshTools::concatenateInto():"); } }} diff --git a/src/Magnum/MeshTools/Copy.cpp b/src/Magnum/MeshTools/Copy.cpp index 291872ddf..85ae40bea 100644 --- a/src/Magnum/MeshTools/Copy.cpp +++ b/src/Magnum/MeshTools/Copy.cpp @@ -132,7 +132,7 @@ Trade::MeshData copy(Trade::MeshData&& mesh) { we can reuse the original array in its entirety */ Containers::Array attributeData; if(!originalAttributeData.deleter() && (mesh.vertexDataFlags() & Trade::DataFlag::Owned)) { - attributeData = std::move(originalAttributeData); + attributeData = Utility::move(originalAttributeData); /* Otherwise we have to allocate a new one and re-route the attributes to a potentially different vertex array */ @@ -156,8 +156,8 @@ Trade::MeshData copy(Trade::MeshData&& mesh) { } return Trade::MeshData{mesh.primitive(), - std::move(indexData), indices, - std::move(vertexData), std::move(attributeData), + Utility::move(indexData), indices, + Utility::move(vertexData), Utility::move(attributeData), vertexCount}; } @@ -167,7 +167,7 @@ Trade::MeshData owned(const Trade::MeshData& mesh) { } Trade::MeshData owned(Trade::MeshData&& mesh) { - return copy(std::move(mesh)); + return copy(Utility::move(mesh)); } #endif diff --git a/src/Magnum/MeshTools/Filter.cpp b/src/Magnum/MeshTools/Filter.cpp index 91df5bfe7..d7230b356 100644 --- a/src/Magnum/MeshTools/Filter.cpp +++ b/src/Magnum/MeshTools/Filter.cpp @@ -62,7 +62,7 @@ Trade::MeshData filterAttributes(const Trade::MeshData& mesh, const Containers:: return Trade::MeshData{mesh.primitive(), {}, mesh.indexData(), indices, - {}, mesh.vertexData(), std::move(filtered), + {}, mesh.vertexData(), Utility::move(filtered), mesh.vertexCount()}; } diff --git a/src/Magnum/MeshTools/FlipNormals.cpp b/src/Magnum/MeshTools/FlipNormals.cpp index 1e5729775..c9bc8f728 100644 --- a/src/Magnum/MeshTools/FlipNormals.cpp +++ b/src/Magnum/MeshTools/FlipNormals.cpp @@ -39,7 +39,7 @@ namespace { template inline void flipFaceWindingInPlaceImplementation(const Containers::StridedArrayView1D& indices) { CORRADE_ASSERT(!(indices.size()%3), "MeshTools::flipNormals(): index count is not divisible by 3!", ); - using std::swap; + using Utility::swap; for(std::size_t i = 0; i != indices.size(); i += 3) swap(indices[i+1], indices[i+2]); } diff --git a/src/Magnum/MeshTools/FullScreenTriangle.cpp b/src/Magnum/MeshTools/FullScreenTriangle.cpp index c7dee9ba8..dd7d7436c 100644 --- a/src/Magnum/MeshTools/FullScreenTriangle.cpp +++ b/src/Magnum/MeshTools/FullScreenTriangle.cpp @@ -51,7 +51,7 @@ GL::Mesh fullScreenTriangle(const GL::Version version) { }; GL::Buffer buffer{GL::Buffer::TargetHint::Array}; buffer.setData(triangle, GL::BufferUsage::StaticDraw); - mesh.addVertexBuffer(std::move(buffer), 0, GL::Attribute<0, Vector2>{}); + mesh.addVertexBuffer(Utility::move(buffer), 0, GL::Attribute<0, Vector2>{}); } #ifdef MAGNUM_TARGET_GLES2 diff --git a/src/Magnum/MeshTools/GenerateIndices.cpp b/src/Magnum/MeshTools/GenerateIndices.cpp index 6701da151..80a01c810 100644 --- a/src/Magnum/MeshTools/GenerateIndices.cpp +++ b/src/Magnum/MeshTools/GenerateIndices.cpp @@ -650,8 +650,8 @@ Trade::MeshData generateIndices(Trade::MeshData&& mesh) { } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ Trade::MeshIndexData indices{MeshIndexType::UnsignedInt, indexData}; - return Trade::MeshData{primitive, std::move(indexData), indices, - std::move(vertexData), std::move(attributeData), vertexCount}; + return Trade::MeshData{primitive, Utility::move(indexData), indices, + Utility::move(vertexData), Utility::move(attributeData), vertexCount}; } Trade::MeshData generateIndices(const Trade::MeshData& mesh) { diff --git a/src/Magnum/MeshTools/GenerateLines.cpp b/src/Magnum/MeshTools/GenerateLines.cpp index e80d87360..e170c3e63 100644 --- a/src/Magnum/MeshTools/GenerateLines.cpp +++ b/src/Magnum/MeshTools/GenerateLines.cpp @@ -267,7 +267,7 @@ Trade::MeshData generateLines(const Trade::MeshData& lineMesh) { Trade::MeshIndexData indices{indexData}; return Trade::MeshData{mesh.primitive(), - indexData ? Containers::arrayAllocatorCast(std::move(indexData)) : Containers::Array{}, indices, + indexData ? Containers::arrayAllocatorCast(Utility::move(indexData)) : Containers::Array{}, indices, mesh.releaseVertexData(), mesh.releaseAttributeData()}; } diff --git a/src/Magnum/MeshTools/GenerateNormals.cpp b/src/Magnum/MeshTools/GenerateNormals.cpp index 4fa7351d3..df8576e8c 100644 --- a/src/Magnum/MeshTools/GenerateNormals.cpp +++ b/src/Magnum/MeshTools/GenerateNormals.cpp @@ -85,7 +85,7 @@ std::pair, std::vector> generateFlatNormals(co CORRADE_IGNORE_DEPRECATED_PUSH normalIndices = duplicate(normalIndices, removeDuplicates(normals)); CORRADE_IGNORE_DEPRECATED_POP - return {std::move(normalIndices), std::move(normals)}; + return {Utility::move(normalIndices), Utility::move(normals)}; } #endif diff --git a/src/Magnum/MeshTools/Interleave.cpp b/src/Magnum/MeshTools/Interleave.cpp index 198739e8c..67b980833 100644 --- a/src/Magnum/MeshTools/Interleave.cpp +++ b/src/Magnum/MeshTools/Interleave.cpp @@ -174,7 +174,7 @@ Containers::Array interleavedLayout(Trade::MeshData&& mesh.releaseAttributeData(); Containers::Array attributeData; if(!extraAttributeCount && !originalAttributeData.deleter()) - attributeData = std::move(originalAttributeData); + attributeData = Utility::move(originalAttributeData); else { attributeData = Containers::Array{originalAttributeCount + extraAttributeCount}; Utility::copy(originalAttributeData, attributeData.prefix(originalAttributeCount)); @@ -223,7 +223,7 @@ Containers::Array interleavedLayout(Trade::MeshData&& } Trade::MeshData interleavedLayout(Trade::MeshData&& mesh, const UnsignedInt vertexCount, const Containers::ArrayView extra, const InterleaveFlags flags) { - Containers::Array attributeData = Implementation::interleavedLayout(std::move(mesh), extra, flags); + Containers::Array attributeData = Implementation::interleavedLayout(Utility::move(mesh), extra, flags); /* If there are no attributes, bail -- return an empty mesh with desired vertex count but nothing else */ @@ -240,11 +240,11 @@ Trade::MeshData interleavedLayout(Trade::MeshData&& mesh, const UnsignedInt vert attribute = Implementation::remapAttributeData(attribute, vertexCount, vertexData, vertexData); } - return Trade::MeshData{mesh.primitive(), std::move(vertexData), std::move(attributeData)}; + return Trade::MeshData{mesh.primitive(), Utility::move(vertexData), Utility::move(attributeData)}; } Trade::MeshData interleavedLayout(Trade::MeshData&& mesh, const UnsignedInt vertexCount, const std::initializer_list extra, const InterleaveFlags flags) { - return interleavedLayout(std::move(mesh), vertexCount, Containers::arrayView(extra), flags); + return interleavedLayout(Utility::move(mesh), vertexCount, Containers::arrayView(extra), flags); } Trade::MeshData interleavedLayout(const Trade::MeshData& mesh, const UnsignedInt vertexCount, const Containers::ArrayView extra, const InterleaveFlags flags) { @@ -321,8 +321,9 @@ Trade::MeshData interleave(Trade::MeshData&& mesh, const Containers::ArrayView extra, const InterleaveFlags flags) { - return interleave(std::move(mesh), Containers::arrayView(extra), flags); + return interleave(Utility::move(mesh), Containers::arrayView(extra), flags); } Trade::MeshData interleave(const Trade::MeshData& mesh, const Containers::ArrayView extra, const InterleaveFlags flags) { @@ -382,7 +383,7 @@ Trade::MeshData interleave(const Trade::MeshData& mesh, const Containers::ArrayV } Trade::MeshData interleave(const Trade::MeshData& mesh, const std::initializer_list extra, const InterleaveFlags flags) { - return interleave(std::move(mesh), Containers::arrayView(extra), flags); + return interleave(Utility::move(mesh), Containers::arrayView(extra), flags); } }} diff --git a/src/Magnum/MeshTools/RemoveDuplicates.cpp b/src/Magnum/MeshTools/RemoveDuplicates.cpp index 3676de5ec..bb0de2c2c 100644 --- a/src/Magnum/MeshTools/RemoveDuplicates.cpp +++ b/src/Magnum/MeshTools/RemoveDuplicates.cpp @@ -102,7 +102,7 @@ std::size_t removeDuplicatesInto(const Containers::StridedArrayView2D, std::size_t> removeDuplicates(const Containers::StridedArrayView2D& data) { Containers::Array indices{NoInit, data.size()[0]}; const std::size_t size = removeDuplicatesInto(data, indices); - return {std::move(indices), size}; + return {Utility::move(indices), size}; } std::size_t removeDuplicatesInPlaceInto(const Containers::StridedArrayView2D& data, const Containers::StridedArrayView1D& indices) { @@ -160,7 +160,7 @@ std::size_t removeDuplicatesInPlaceInto(const Containers::StridedArrayView2D, std::size_t> removeDuplicatesInPlace(const Containers::StridedArrayView2D& data) { Containers::Array indices{NoInit, data.size()[0]}; const std::size_t size = removeDuplicatesInPlaceInto(data, indices); - return {std::move(indices), size}; + return {Utility::move(indices), size}; } namespace { @@ -353,7 +353,7 @@ template std::size_t removeDuplicatesFuzzyInPlaceIntoImplementation(con template Containers::Pair, std::size_t> removeDuplicatesFuzzyInPlaceImplementation(const Containers::StridedArrayView2D& data, const T epsilon) { Containers::Array indices{NoInit, data.size()[0]}; const std::size_t size = removeDuplicatesFuzzyInPlaceIntoImplementation(data, indices, epsilon); - return {std::move(indices), size}; + return {Utility::move(indices), size}; } } @@ -461,8 +461,8 @@ Trade::MeshData removeDuplicates(const Trade::MeshData& mesh) { Trade::MeshIndexData indices{indexType, indexData}; return Trade::MeshData{ownedInterleaved.primitive(), - std::move(indexData), indices, - std::move(uniqueVertexData), std::move(attributeData), + Utility::move(indexData), indices, + Utility::move(uniqueVertexData), Utility::move(attributeData), uniqueVertexCount}; } @@ -586,7 +586,7 @@ Trade::MeshData removeDuplicatesFuzzy(const Trade::MeshData& mesh, const Float f Trade::MeshData layout = interleavedLayout(owned, vertexCount); Trade::MeshIndexData indices{indexType, indexData}; Trade::MeshData out{layout.primitive(), - std::move(indexData), indices, + Utility::move(indexData), indices, layout.releaseVertexData(), layout.releaseAttributeData(), vertexCount}; /* Trim the views to only the unique combinations, duplicate the attributes diff --git a/src/Magnum/MeshTools/Test/CompileGLTest.cpp b/src/Magnum/MeshTools/Test/CompileGLTest.cpp index 6f325b1d9..31f17a10c 100644 --- a/src/Magnum/MeshTools/Test/CompileGLTest.cpp +++ b/src/Magnum/MeshTools/Test/CompileGLTest.cpp @@ -679,7 +679,7 @@ template void CompileGLTest::twoDimensions() { Trade::MeshData meshData{MeshPrimitive::Triangles, {}, indexData, indices, - {}, vertexData, std::move(attributeData)}; + {}, vertexData, Utility::move(attributeData)}; /* Duplicate everything if data is non-indexed */ if(data.flags & Flag::NonIndexed) { @@ -698,7 +698,7 @@ template void CompileGLTest::twoDimensions() { #ifdef MAGNUM_BUILD_DEPRECATED CORRADE_IGNORE_DEPRECATED_PUSH /** @todo remove once MeshDataXD is gone */ #endif - GL::Mesh mesh = compile(T{std::move(meshData)}); + GL::Mesh mesh = compile(T{Utility::move(meshData)}); #ifdef MAGNUM_BUILD_DEPRECATED CORRADE_IGNORE_DEPRECATED_POP #endif @@ -900,7 +900,7 @@ template void CompileGLTest::threeDimensions() { Trade::MeshData meshData{MeshPrimitive::Triangles, {}, indexData, indices, - {}, vertexData, std::move(attributeData)}; + {}, vertexData, Utility::move(attributeData)}; /* Duplicate everything if data is non-indexed */ if(data.flags & Flag::NonIndexed) { @@ -924,7 +924,7 @@ template void CompileGLTest::threeDimensions() { #ifdef MAGNUM_BUILD_DEPRECATED CORRADE_IGNORE_DEPRECATED_PUSH /** @todo remove once MeshDataXD is gone */ #endif - GL::Mesh mesh = compile(T{std::move(meshData)}, flags); + GL::Mesh mesh = compile(T{Utility::move(meshData)}, flags); #ifdef MAGNUM_BUILD_DEPRECATED CORRADE_IGNORE_DEPRECATED_POP #endif @@ -1343,7 +1343,7 @@ void CompileGLTest::skinning() { vertices.slice(&Vertex::position)); arrayAppend(attributeData, data.attributes); - Trade::MeshData meshData{MeshPrimitive::TriangleStrip, {}, vertexData, std::move(attributeData)}; + Trade::MeshData meshData{MeshPrimitive::TriangleStrip, {}, vertexData, Utility::move(attributeData)}; Containers::Pair jointCount = compiledPerVertexJointCount(meshData); CORRADE_COMPARE(jointCount.first(), data.expectedJointCount); @@ -1490,7 +1490,7 @@ void CompileGLTest::conflictingAttributes() { Trade::MeshData meshData{MeshPrimitive::Triangles, {}, indexData, Trade::MeshIndexData{indexData}, - {}, vertexData, std::move(attributeData)}; + {}, vertexData, Utility::move(attributeData)}; GL::Mesh mesh{NoCreate}; @@ -1774,11 +1774,11 @@ void CompileGLTest::externalBuffers() { GL::Mesh mesh{NoCreate}; if(data.moveIndices && data.moveVertices) - mesh = compile(meshData, std::move(indices), std::move(vertices)); + mesh = compile(meshData, Utility::move(indices), Utility::move(vertices)); else if(data.moveIndices && !data.moveVertices) - mesh = compile(meshData, std::move(indices), vertices); + mesh = compile(meshData, Utility::move(indices), vertices); else if(!data.moveIndices && data.moveVertices) - mesh = compile(meshData, indices, std::move(vertices)); + mesh = compile(meshData, indices, Utility::move(vertices)); else mesh = compile(meshData, indices, vertices); diff --git a/src/Magnum/MeshTools/Test/CompileLinesGLTest.cpp b/src/Magnum/MeshTools/Test/CompileLinesGLTest.cpp index 30bec16f7..c70479d81 100644 --- a/src/Magnum/MeshTools/Test/CompileLinesGLTest.cpp +++ b/src/Magnum/MeshTools/Test/CompileLinesGLTest.cpp @@ -171,7 +171,7 @@ void CompileLinesGLTest::twoDimensions() { if(data.colors) arrayAppend(attributes, InPlaceInit, Trade::MeshAttribute::Color, vertices.slice(&Vertex::color)); - GL::Mesh mesh = compileLines(generateLines(Trade::MeshData{MeshPrimitive::LineLoop, {}, vertexData, std::move(attributes)})); + GL::Mesh mesh = compileLines(generateLines(Trade::MeshData{MeshPrimitive::LineLoop, {}, vertexData, Utility::move(attributes)})); Shaders::LineGL2D shader{Shaders::LineGL2D::Configuration{} .setFlags(data.colors ? Shaders::LineGL2D::Flag::VertexColor : Shaders::LineGL2D::Flags{}) diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index c5753fd9d..b9c705f27 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -318,7 +318,7 @@ void CompressIndicesTest::compressMeshDataMove() { UnsignedInt indices[] = {102, 101, 100, 101, 102}; Trade::MeshData data{MeshPrimitive::TriangleFan, {}, indices, Trade::MeshIndexData{indices}, - std::move(vertexData), { + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positionView}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normalView} }}; @@ -326,7 +326,7 @@ void CompressIndicesTest::compressMeshDataMove() { CORRADE_COMPARE(data.attributeOffset(0), 0); CORRADE_COMPARE(data.attributeOffset(1), 103*sizeof(Vector2)); - Trade::MeshData compressed = compressIndices(std::move(data)); + Trade::MeshData compressed = compressIndices(Utility::move(data)); CORRADE_COMPARE(compressed.indexCount(), 5); CORRADE_COMPARE(compressed.indexType(), MeshIndexType::UnsignedShort); CORRADE_COMPARE_AS(compressed.indices(), @@ -348,7 +348,7 @@ void CompressIndicesTest::compressMeshDataNonIndexed() { std::ostringstream out; Error redirectError{&out}; compressIndices(mesh); - compressIndices(std::move(mesh)); + compressIndices(Utility::move(mesh)); CORRADE_COMPARE(out.str(), "MeshTools::compressIndices(): mesh data not indexed\n" "MeshTools::compressIndices(): mesh data not indexed\n"); @@ -364,7 +364,7 @@ void CompressIndicesTest::compressMeshDataImplementationSpecificIndexType() { std::ostringstream out; Error redirectError{&out}; compressIndices(mesh); - compressIndices(std::move(mesh)); + compressIndices(Utility::move(mesh)); CORRADE_COMPARE(out.str(), "MeshTools::compressIndices(): mesh has an implementation-specific index type 0xcaca\n" "MeshTools::compressIndices(): mesh has an implementation-specific index type 0xcaca\n"); diff --git a/src/Magnum/MeshTools/Test/ConcatenateTest.cpp b/src/Magnum/MeshTools/Test/ConcatenateTest.cpp index 9a243f22d..65ceafaad 100644 --- a/src/Magnum/MeshTools/Test/ConcatenateTest.cpp +++ b/src/Magnum/MeshTools/Test/ConcatenateTest.cpp @@ -485,8 +485,8 @@ void ConcatenateTest::concatenateInto() { VertexFormat::Vector3, nullptr}; Trade::MeshIndexData indices{MeshIndexType::UnsignedInt, indexData}; Trade::MeshData dst{MeshPrimitive::Triangles, - std::move(indexData), indices, - std::move(vertexData), std::move(attributeData)}; + Utility::move(indexData), indices, + Utility::move(vertexData), Utility::move(attributeData)}; const Vector2 positionsA[]{ {-1.0f, -1.0f}, @@ -562,8 +562,8 @@ void ConcatenateTest::concatenateIntoNoIndexArray() { VertexFormat::Vector2, nullptr}; Trade::MeshIndexData indices{MeshIndexType::UnsignedInt, indexData}; Trade::MeshData dst{MeshPrimitive::Triangles, - std::move(indexData), indices, - std::move(vertexData), std::move(attributeData)}; + Utility::move(indexData), indices, + Utility::move(vertexData), Utility::move(attributeData)}; CORRADE_VERIFY(dst.isIndexed()); const Vector2 positions[]{ @@ -605,7 +605,7 @@ void ConcatenateTest::concatenateIntoNonOwnedAttributeArray() { VertexFormat::Vector2, nullptr} }; Trade::MeshData dst{MeshPrimitive::Triangles, - std::move(vertexData), Trade::meshAttributeDataNonOwningArray(attributeData)}; + Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(attributeData)}; const Vector2 positions[]{ {-1.0f, -1.0f}, diff --git a/src/Magnum/MeshTools/Test/CopyTest.cpp b/src/Magnum/MeshTools/Test/CopyTest.cpp index 954a564a3..890e7c890 100644 --- a/src/Magnum/MeshTools/Test/CopyTest.cpp +++ b/src/Magnum/MeshTools/Test/CopyTest.cpp @@ -317,8 +317,8 @@ void CopyTest::copyRvalueIndicesVerticesAttributesOwned() { const Trade::MeshAttributeData* originalAttributes = attributes; Trade::MeshData copy = MeshTools::copy(Trade::MeshData{MeshPrimitive::Triangles, - std::move(indexData), Trade::MeshIndexData{indices}, - std::move(vertexData), std::move(attributes)}); + Utility::move(indexData), Trade::MeshIndexData{indices}, + Utility::move(vertexData), Utility::move(attributes)}); CORRADE_VERIFY(copy.isIndexed()); CORRADE_COMPARE(copy.primitive(), MeshPrimitive::Triangles); CORRADE_COMPARE(copy.indexDataFlags(), Trade::DataFlag::Mutable|Trade::DataFlag::Owned); @@ -354,7 +354,7 @@ void CopyTest::copyRvalueAttributesOwned() { Containers::arrayView(positions)}; const Trade::MeshAttributeData* originalAttributes = attributes; - Trade::MeshData copy = MeshTools::copy(Trade::MeshData{MeshPrimitive::Triangles, {}, positions, std::move(attributes)}); + Trade::MeshData copy = MeshTools::copy(Trade::MeshData{MeshPrimitive::Triangles, {}, positions, Utility::move(attributes)}); CORRADE_COMPARE(copy.primitive(), MeshPrimitive::Triangles); CORRADE_COMPARE(copy.vertexDataFlags(), Trade::DataFlag::Mutable|Trade::DataFlag::Owned); CORRADE_COMPARE(copy.vertexDataFlags(), Trade::DataFlag::Mutable|Trade::DataFlag::Owned); diff --git a/src/Magnum/MeshTools/Test/FilterTest.cpp b/src/Magnum/MeshTools/Test/FilterTest.cpp index f8e37b669..12e863913 100644 --- a/src/Magnum/MeshTools/Test/FilterTest.cpp +++ b/src/Magnum/MeshTools/Test/FilterTest.cpp @@ -132,8 +132,8 @@ void FilterTest::attributes() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{data.indexType, indices}, - std::move(vertexData), { + Utility::move(indexData), Trade::MeshIndexData{data.indexType, indices}, + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::Tangent, vertices.slice(&Vertex::tangent)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)}, @@ -179,7 +179,7 @@ void FilterTest::attributesNoIndexData() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(vertexData), { + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)} }}; @@ -229,8 +229,8 @@ void FilterTest::onlyAttributes() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{data.indexType, indices}, - std::move(vertexData), { + Utility::move(indexData), Trade::MeshIndexData{data.indexType, indices}, + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::Tangent, vertices.slice(&Vertex::tangent)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)}, @@ -281,7 +281,7 @@ void FilterTest::onlyAttributesNoIndexData() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(vertexData), { + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)} }}; @@ -310,7 +310,7 @@ void FilterTest::onlyAttributesNoAttributeData() { Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Trade::MeshData mesh{MeshPrimitive::Points, - std::move(indexData), Trade::MeshIndexData{indices}, 15}; + Utility::move(indexData), Trade::MeshIndexData{indices}, 15}; Trade::MeshData filtered = filterOnlyAttributes(mesh, { Trade::MeshAttribute::Position @@ -342,8 +342,8 @@ void FilterTest::onlyAttributeIds() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{data.indexType, indices}, - std::move(vertexData), { + Utility::move(indexData), Trade::MeshIndexData{data.indexType, indices}, + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::Tangent, vertices.slice(&Vertex::tangent)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)}, @@ -411,7 +411,7 @@ void FilterTest::onlyAttributeIdsNoIndexData() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(vertexData), { + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)} }}; @@ -442,7 +442,7 @@ void FilterTest::onlyAttributeIdsNoAttributeData() { Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Trade::MeshData mesh{MeshPrimitive::Points, - std::move(indexData), Trade::MeshIndexData{indices}, 15}; + Utility::move(indexData), Trade::MeshIndexData{indices}, 15}; CORRADE_IGNORE_DEPRECATED_PUSH Trade::MeshData filtered = filterOnlyAttributes(mesh, std::initializer_list{}); @@ -474,8 +474,8 @@ void FilterTest::exceptAttributes() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{data.indexType, indices}, - std::move(vertexData), { + Utility::move(indexData), Trade::MeshIndexData{data.indexType, indices}, + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::Tangent, vertices.slice(&Vertex::tangent)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)}, @@ -524,7 +524,7 @@ void FilterTest::exceptAttributesNoIndexData() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(vertexData), { + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)} }}; @@ -554,7 +554,7 @@ void FilterTest::exceptAttributesNoAttributeData() { Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Trade::MeshData mesh{MeshPrimitive::Points, - std::move(indexData), Trade::MeshIndexData{indices}, 15}; + Utility::move(indexData), Trade::MeshIndexData{indices}, 15}; Trade::MeshData filtered = filterExceptAttributes(mesh, { Trade::MeshAttribute::Position @@ -586,8 +586,8 @@ void FilterTest::exceptAttributeIds() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{data.indexType, indices}, - std::move(vertexData), { + Utility::move(indexData), Trade::MeshIndexData{data.indexType, indices}, + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::Tangent, vertices.slice(&Vertex::tangent)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)}, @@ -655,7 +655,7 @@ void FilterTest::exceptAttributeIdsNoIndexData() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(vertexData), { + Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, vertices.slice(&Vertex::position)}, Trade::MeshAttributeData{Trade::MeshAttribute::TextureCoordinates, vertices.slice(&Vertex::textureCoordinates1)} }}; @@ -687,7 +687,7 @@ void FilterTest::exceptAttributeIdsNoAttributeData() { Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Trade::MeshData mesh{MeshPrimitive::Points, - std::move(indexData), Trade::MeshIndexData{indices}, 15}; + Utility::move(indexData), Trade::MeshIndexData{indices}, 15}; CORRADE_IGNORE_DEPRECATED_PUSH Trade::MeshData filtered = filterExceptAttributes(mesh, std::initializer_list{}); diff --git a/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp b/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp index 0c1d73ce1..ba1bb7d79 100644 --- a/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp @@ -1232,7 +1232,7 @@ void GenerateIndicesTest::generateIndicesMeshDataMove() { vertices[4].textureCoordinates = {0.6f, 0.4f}; Trade::MeshData out = generateIndices(Trade::MeshData{ - MeshPrimitive::TriangleFan, std::move(vertexData), { + MeshPrimitive::TriangleFan, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, Containers::stridedArrayView(vertices, &vertices[0].position, 5, sizeof(Vertex))}, diff --git a/src/Magnum/MeshTools/Test/InterleaveTest.cpp b/src/Magnum/MeshTools/Test/InterleaveTest.cpp index 8a16b7d62..cdedec58f 100644 --- a/src/Magnum/MeshTools/Test/InterleaveTest.cpp +++ b/src/Magnum/MeshTools/Test/InterleaveTest.cpp @@ -310,7 +310,7 @@ void InterleaveTest::interleavedData() { Containers::StridedArrayView1D normals{vertexData, reinterpret_cast(vertexData.data() + 100 + 8), 3, 20}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals} }}; @@ -342,7 +342,7 @@ void InterleaveTest::interleavedDataUnordered() { Containers::StridedArrayView1D normals{vertexData, reinterpret_cast(vertexData.data() + 100 + 8), 3, 20}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals}, Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions} }}; @@ -365,7 +365,7 @@ void InterleaveTest::interleavedDataGaps() { Containers::StridedArrayView1D normals{vertexData, reinterpret_cast(vertexData.data() + 100 + 24), 3, 40}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals} }}; @@ -388,7 +388,7 @@ void InterleaveTest::interleavedDataAliased() { Containers::StridedArrayView1D normals{vertexData, reinterpret_cast(vertexData.data() + 100), 3, 12}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals} }}; @@ -408,7 +408,7 @@ void InterleaveTest::interleavedDataSingleAttribute() { Containers::Array vertexData{3*8}; auto positions = Containers::arrayCast(vertexData); - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions} }}; CORRADE_VERIFY(MeshTools::isInterleaved(data)); @@ -431,7 +431,7 @@ void InterleaveTest::interleavedDataArrayAttributes() { Containers::StridedArrayView1D positions{vertexData, reinterpret_cast(vertexData.data() + 100 + 5), 3, 40}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::meshAttributeCustom(42), VertexFormat::Float, normals, 3}, Trade::MeshAttributeData{Trade::meshAttributeCustom(43), @@ -454,7 +454,7 @@ void InterleaveTest::interleavedDataZeroStride() { Containers::StridedArrayView1D normals{vertexData, reinterpret_cast(vertexData.data() + 100 + 8), 3, 0}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals} }}; @@ -471,7 +471,7 @@ void InterleaveTest::interleavedDataNegativeStride() { Containers::StridedArrayView1D normals{vertexData, reinterpret_cast(vertexData.data() + 100 + 8), 3, 20}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions.flipped<0>()}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals.flipped<0>()} }}; @@ -535,7 +535,7 @@ void InterleaveTest::interleavedDataNotInterleaved() { auto positions = Containers::arrayCast(vertexData.exceptPrefix(100).prefix(3*8)); auto normals = Containers::arrayCast(vertexData.exceptPrefix(100+3*8)); - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), { + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals}, Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions} }}; @@ -703,7 +703,7 @@ void InterleaveTest::interleavedDataImplementationSpecificVertexFormat() { Containers::StridedArrayView1D{vertexData, vertexData.data() + 100 + 8, 3, 8}}; - Trade::MeshData data{MeshPrimitive::Triangles, std::move(vertexData), {positions, normals}}; + Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), {positions, normals}}; CORRADE_VERIFY(!MeshTools::isInterleaved(data)); } @@ -747,7 +747,7 @@ void InterleaveTest::interleavedLayout() { Trade::MeshIndexData indices{Containers::arrayCast(indexData)}; Trade::MeshData data{MeshPrimitive::TriangleFan, - std::move(indexData), indices, std::move(vertexData), + Utility::move(indexData), indices, Utility::move(vertexData), /* Verify that interleavedLayout() won't attempt to modify the const array (see interleavedLayoutRvalue()) */ Trade::meshAttributeDataNonOwningArray(attributeData)}; @@ -811,7 +811,7 @@ void InterleaveTest::interleavedLayoutExtra() { Containers::arrayCast(vertexData.exceptPrefix(3*8))}; Trade::MeshData data{MeshPrimitive::Triangles, - std::move(vertexData), {positions, normals}}; + Utility::move(vertexData), {positions, normals}}; CORRADE_VERIFY(!MeshTools::isInterleaved(data)); Trade::MeshData layout = MeshTools::interleavedLayout(data, 7, { @@ -868,7 +868,7 @@ void InterleaveTest::interleavedLayoutExtraAliased() { Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::StridedArrayView1D{vertexData, reinterpret_cast(vertexData.data()), 3, 12}}; Trade::MeshData data{MeshPrimitive::Triangles, - std::move(vertexData), {positions}}; + Utility::move(vertexData), {positions}}; Trade::MeshData layout = MeshTools::interleavedLayout(data, 100, { /* Normals at the same place as positions */ @@ -897,7 +897,7 @@ void InterleaveTest::interleavedLayoutExtraTooNegativePadding() { Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::StridedArrayView1D{vertexData, reinterpret_cast(vertexData.data()), 3, 12}}; Trade::MeshData data{MeshPrimitive::Triangles, - std::move(vertexData), {positions}}; + Utility::move(vertexData), {positions}}; std::ostringstream out; Error redirectError{&out}; @@ -964,8 +964,8 @@ void InterleaveTest::interleavedLayoutAlreadyInterleaved() { Trade::MeshIndexData indices{Containers::arrayCast(indexData)}; Trade::MeshData mesh{MeshPrimitive::Triangles, - std::move(indexData), indices, - std::move(vertexData), {positions, normals}}; + Utility::move(indexData), indices, + Utility::move(vertexData), {positions, normals}}; CORRADE_VERIFY(MeshTools::isInterleaved(mesh)); /* To catch when the default argument becomes different */ @@ -1014,8 +1014,8 @@ void InterleaveTest::interleavedLayoutAlreadyInterleavedAliased() { Trade::MeshIndexData indices{Containers::arrayCast(indexData)}; Trade::MeshData mesh{MeshPrimitive::Triangles, - std::move(indexData), indices, - std::move(vertexData), {positions, normals}}; + Utility::move(indexData), indices, + Utility::move(vertexData), {positions, normals}}; CORRADE_VERIFY(MeshTools::isInterleaved(mesh)); /* To catch when the default argument becomes different */ @@ -1060,7 +1060,7 @@ void InterleaveTest::interleavedLayoutAlreadyInterleavedExtra() { Containers::StridedArrayView1D{vertexData, reinterpret_cast(vertexData.data() + 100 + 10), 3, 24}}; Trade::MeshData mesh{MeshPrimitive::Triangles, - std::move(vertexData), {positions, normals}}; + Utility::move(vertexData), {positions, normals}}; CORRADE_VERIFY(MeshTools::isInterleaved(mesh)); std::initializer_list extra{ @@ -1140,14 +1140,14 @@ void InterleaveTest::interleavedLayoutRvalue() { Trade::MeshIndexData indices{Containers::arrayCast(indexData)}; Trade::MeshData data{MeshPrimitive::TriangleFan, - std::move(indexData), indices, - std::move(vertexData), std::move(attributeData)}; + Utility::move(indexData), indices, + Utility::move(vertexData), Utility::move(attributeData)}; CORRADE_VERIFY(!MeshTools::isInterleaved(data)); /* Check that the attribute data array gets reused when moving a rvalue. Explicitly passing an empty init list to verify the rvalue gets propagated correctly through all functions. */ - Trade::MeshData layout = MeshTools::interleavedLayout(std::move(data), 10, + Trade::MeshData layout = MeshTools::interleavedLayout(Utility::move(data), 10, std::initializer_list{}); CORRADE_VERIFY(layout.attributeData().data() == originalAttributeData); @@ -1416,15 +1416,15 @@ void InterleaveTest::interleaveMeshDataAlreadyInterleavedMove() { const Trade::MeshAttributeData* attributePointer = attributeData; Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(indexData), Trade::MeshIndexData{indexView}, - std::move(vertexData), std::move(attributeData)}; + Utility::move(indexData), Trade::MeshIndexData{indexView}, + Utility::move(vertexData), Utility::move(attributeData)}; CORRADE_VERIFY(MeshTools::isInterleaved(mesh)); /* To catch when the default argument becomes different */ Trade::MeshData interleaved = data.flags ? - MeshTools::interleave(std::move(mesh), {}, *data.flags) : + MeshTools::interleave(Utility::move(mesh), {}, *data.flags) : /* {} just to cover the initializer_list overload :P */ - MeshTools::interleave(std::move(mesh), {}); + MeshTools::interleave(Utility::move(mesh), {}); CORRADE_VERIFY(MeshTools::isInterleaved(interleaved)); CORRADE_COMPARE(interleaved.indexCount(), 2); @@ -1465,14 +1465,14 @@ void InterleaveTest::interleaveMeshDataAlreadyInterleavedMoveIndices() { const Trade::MeshAttributeData* attributePointer = attributeData; Trade::MeshData mesh{MeshPrimitive::TriangleFan, - std::move(indexData), Trade::MeshIndexData{data.indexType,indices}, - std::move(vertexData), std::move(attributeData)}; + Utility::move(indexData), Trade::MeshIndexData{data.indexType,indices}, + Utility::move(vertexData), Utility::move(attributeData)}; CORRADE_VERIFY(MeshTools::isInterleaved(mesh)); /* To catch when the default argument becomes different */ Trade::MeshData interleaved = data.flags ? - MeshTools::interleave(std::move(mesh), {}, *data.flags) : - MeshTools::interleave(std::move(mesh)); + MeshTools::interleave(Utility::move(mesh), {}, *data.flags) : + MeshTools::interleave(Utility::move(mesh)); CORRADE_VERIFY(MeshTools::isInterleaved(interleaved)); CORRADE_COMPARE(interleaved.indexType(), data.indexType); @@ -1520,10 +1520,10 @@ void InterleaveTest::interleaveMeshDataAlreadyInterleavedMoveNonOwned() { Trade::MeshData data{MeshPrimitive::TriangleFan, {}, indexData, Trade::MeshIndexData{indexView}, - {}, vertexData, std::move(attributeData)}; + {}, vertexData, Utility::move(attributeData)}; CORRADE_VERIFY(MeshTools::isInterleaved(data)); - Trade::MeshData interleaved = MeshTools::interleave(std::move(data)); + Trade::MeshData interleaved = MeshTools::interleave(Utility::move(data)); CORRADE_VERIFY(MeshTools::isInterleaved(interleaved)); CORRADE_COMPARE(interleaved.indexCount(), 2); CORRADE_COMPARE(interleaved.attributeCount(), 2); diff --git a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp index 376ff3ff5..9d28400a8 100644 --- a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp +++ b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp @@ -942,7 +942,7 @@ void RemoveDuplicatesTest::removeDuplicatesMeshDataFuzzy() { Trade::MeshData mesh{MeshPrimitive::Lines, {}, indexView, indices, - {}, vertexData, std::move(attributes)}; + {}, vertexData, Utility::move(attributes)}; Trade::MeshData unique = MeshTools::removeDuplicatesFuzzy(mesh, data.epsilon); diff --git a/src/Magnum/MeshTools/Test/TransformTest.cpp b/src/Magnum/MeshTools/Test/TransformTest.cpp index 2a82f992f..f5d7f3c89 100644 --- a/src/Magnum/MeshTools/Test/TransformTest.cpp +++ b/src/Magnum/MeshTools/Test/TransformTest.cpp @@ -512,7 +512,7 @@ template void TransformTest::meshData2D() { Trade::MeshData mesh{MeshPrimitive::TriangleStrip, {}, data.indexed ? Containers::arrayView(indices) : nullptr, data.indexed ? Trade::MeshIndexData{indices} : Trade::MeshIndexData{nullptr}, - {}, vertices, std::move(attributes)}; + {}, vertices, Utility::move(attributes)}; CORRADE_COMPARE(mesh.isIndexed(), data.indexed); Trade::MeshData out = transform2D(mesh, data.transformation, data.id, data.morphTargetId); @@ -646,12 +646,12 @@ void TransformTest::meshData2DRvaluePassthrough() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleFan, - data.indexed ? std::move(indexData) : nullptr, + data.indexed ? Utility::move(indexData) : nullptr, data.indexed ? Trade::MeshIndexData{indices} : Trade::MeshIndexData{nullptr}, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transform2D(std::move(mesh), transformation, data.id, data.morphTargetId); + Trade::MeshData out = transform2D(Utility::move(mesh), transformation, data.id, data.morphTargetId); CORRADE_COMPARE(out.primitive(), MeshPrimitive::TriangleFan); /* Indices should be passed through unchanged */ @@ -696,10 +696,10 @@ void TransformTest::meshData2DRvaluePassthroughIndexDataNotOwned() { Trade::MeshData mesh{MeshPrimitive::TriangleStrip, {}, indices, Trade::MeshIndexData{indices}, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transform2D(std::move(mesh), transformation); + Trade::MeshData out = transform2D(Utility::move(mesh), transformation); /* Indices should be passed through unchanged */ CORRADE_VERIFY(out.isIndexed()); @@ -739,11 +739,11 @@ void TransformTest::meshData2DRvaluePassthroughVertexDataNotOwned() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{indices}, - {}, vertices, std::move(attributes)}; + Utility::move(indexData), Trade::MeshIndexData{indices}, + {}, vertices, Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transform2D(std::move(mesh), transformation); + Trade::MeshData out = transform2D(Utility::move(mesh), transformation); /* Indices should be passed through unchanged */ CORRADE_VERIFY(out.isIndexed()); @@ -799,10 +799,10 @@ void TransformTest::meshData2DRvaluePassthroughWrongFormat() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transform2D(std::move(mesh), transformation); + Trade::MeshData out = transform2D(Utility::move(mesh), transformation); /* The vertices should be expanded to floats and transformed */ CORRADE_COMPARE_AS(out.attribute(Trade::MeshAttribute::Position), Containers::arrayView({ @@ -925,7 +925,7 @@ template void TransformTest::meshData3D() { Trade::MeshData mesh{MeshPrimitive::TriangleStrip, {}, data.indexed ? Containers::arrayView(indices) : nullptr, data.indexed ? Trade::MeshIndexData{indices} : Trade::MeshIndexData{nullptr}, - {}, vertices, std::move(attributes)}; + {}, vertices, Utility::move(attributes)}; CORRADE_COMPARE(mesh.isIndexed(), data.indexed); Trade::MeshData out = transform3D(mesh, data.transformation, data.id, data.morphTargetId); @@ -1125,12 +1125,12 @@ void TransformTest::meshData3DRvaluePassthrough() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleFan, - data.indexed ? std::move(indexData) : nullptr, + data.indexed ? Utility::move(indexData) : nullptr, data.indexed ? Trade::MeshIndexData{indices} : Trade::MeshIndexData{nullptr}, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix4 transformation = Matrix4::rotationX(35.0_degf); - Trade::MeshData out = transform3D(std::move(mesh), transformation, data.id, data.morphTargetId); + Trade::MeshData out = transform3D(Utility::move(mesh), transformation, data.id, data.morphTargetId); CORRADE_COMPARE(out.primitive(), MeshPrimitive::TriangleFan); /* Indices should be passed through unchanged */ @@ -1209,10 +1209,10 @@ void TransformTest::meshData3DRvaluePassthroughIndexDataNotOwned() { Trade::MeshData mesh{MeshPrimitive::TriangleStrip, {}, indices, Trade::MeshIndexData{indices}, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix4 transformation = Matrix4::rotationX(35.0_degf); - Trade::MeshData out = transform3D(std::move(mesh), transformation); + Trade::MeshData out = transform3D(Utility::move(mesh), transformation); /* Indices should be passed through unchanged */ CORRADE_VERIFY(out.isIndexed()); @@ -1252,11 +1252,11 @@ void TransformTest::meshData3DRvaluePassthroughVertexDataNotOwned() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{indices}, - {}, vertices, std::move(attributes)}; + Utility::move(indexData), Trade::MeshIndexData{indices}, + {}, vertices, Utility::move(attributes)}; const Matrix4 transformation = Matrix4::rotationX(35.0_degf); - Trade::MeshData out = transform3D(std::move(mesh), transformation); + Trade::MeshData out = transform3D(Utility::move(mesh), transformation); /* Indices should be passed through unchanged */ CORRADE_VERIFY(out.isIndexed()); @@ -1336,10 +1336,10 @@ void TransformTest::meshData3DRvaluePassthroughWrongFormat() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix4 transformation = Matrix4::rotationX(35.0_degf); - Trade::MeshData out = transform3D(std::move(mesh), transformation); + Trade::MeshData out = transform3D(Utility::move(mesh), transformation); /* The vertices should be expanded to floats and transformed */ CORRADE_COMPARE_AS(out.attribute(Trade::MeshAttribute::Position), Containers::arrayView({ @@ -1436,7 +1436,7 @@ void TransformTest::meshData3DInPlaceWrongFormat() { if(data.normalFormat != VertexFormat{}) arrayAppend(attributes, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, data.normalFormat, nullptr}); - Trade::MeshData mesh{MeshPrimitive::Points, nullptr, std::move(attributes)}; + Trade::MeshData mesh{MeshPrimitive::Points, nullptr, Utility::move(attributes)}; std::ostringstream out; Error redirectError{&out}; @@ -1478,7 +1478,7 @@ template void TransformTest::meshDataTextureCoordinates2D() { Trade::MeshData mesh{MeshPrimitive::TriangleStrip, {}, data.indexed ? Containers::arrayView(indices) : nullptr, data.indexed ? Trade::MeshIndexData{indices} : Trade::MeshIndexData{nullptr}, - {}, vertices, std::move(attributes)}; + {}, vertices, Utility::move(attributes)}; CORRADE_COMPARE(mesh.isIndexed(), data.indexed); Trade::MeshData out = transformTextureCoordinates2D(mesh, data.transformation, data.id, data.morphTargetId); @@ -1599,12 +1599,12 @@ void TransformTest::meshDataTextureCoordinates2DRvaluePassthrough() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleFan, - data.indexed ? std::move(indexData) : nullptr, + data.indexed ? Utility::move(indexData) : nullptr, data.indexed ? Trade::MeshIndexData{indices} : Trade::MeshIndexData{nullptr}, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transformTextureCoordinates2D(std::move(mesh), transformation, data.id, data.morphTargetId); + Trade::MeshData out = transformTextureCoordinates2D(Utility::move(mesh), transformation, data.id, data.morphTargetId); CORRADE_COMPARE(out.primitive(), MeshPrimitive::TriangleFan); /* Indices should be passed through unchanged */ @@ -1649,10 +1649,10 @@ void TransformTest::meshDataTextureCoordinates2DRvaluePassthroughIndexDataNotOwn Trade::MeshData mesh{MeshPrimitive::TriangleStrip, {}, indices, Trade::MeshIndexData{indices}, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transformTextureCoordinates2D(std::move(mesh), transformation); + Trade::MeshData out = transformTextureCoordinates2D(Utility::move(mesh), transformation); /* Indices should be passed through unchanged */ CORRADE_VERIFY(out.isIndexed()); @@ -1692,11 +1692,11 @@ void TransformTest::meshDataTextureCoordinates2DRvaluePassthroughVertexDataNotOw const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(indexData), Trade::MeshIndexData{indices}, - {}, vertices, std::move(attributes)}; + Utility::move(indexData), Trade::MeshIndexData{indices}, + {}, vertices, Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transformTextureCoordinates2D(std::move(mesh), transformation); + Trade::MeshData out = transformTextureCoordinates2D(Utility::move(mesh), transformation); /* Indices should be passed through unchanged */ CORRADE_VERIFY(out.isIndexed()); @@ -1752,10 +1752,10 @@ void TransformTest::meshDataTextureCoordinates2DRvaluePassthroughWrongFormat() { const void* originalAttributeData = attributes; Trade::MeshData mesh{MeshPrimitive::TriangleStrip, - std::move(vertexData), std::move(attributes)}; + Utility::move(vertexData), Utility::move(attributes)}; const Matrix3 transformation = Matrix3::rotation(35.0_degf); - Trade::MeshData out = transformTextureCoordinates2D(std::move(mesh), transformation); + Trade::MeshData out = transformTextureCoordinates2D(Utility::move(mesh), transformation); /* The vertices should be expanded to floats and transformed */ CORRADE_COMPARE_AS(out.attribute(Trade::MeshAttribute::TextureCoordinates), Containers::arrayView({ diff --git a/src/Magnum/MeshTools/Transform.cpp b/src/Magnum/MeshTools/Transform.cpp index 2799d374a..ca95cdf7e 100644 --- a/src/Magnum/MeshTools/Transform.cpp +++ b/src/Magnum/MeshTools/Transform.cpp @@ -96,7 +96,7 @@ Trade::MeshData transform2D(Trade::MeshData&& mesh, const Matrix3& transformatio positionAttributeId && mesh.attributeFormat(*positionAttributeId) == VertexFormat::Vector2 ) { transform2DInPlace(mesh, transformation, id, morphTargetId); - return std::move(mesh); + return Utility::move(mesh); } /* Otherwise delegate to the function that does all the copying and format @@ -106,7 +106,7 @@ Trade::MeshData transform2D(Trade::MeshData&& mesh, const Matrix3& transformatio #ifdef MAGNUM_BUILD_DEPRECATED Trade::MeshData transform2D(Trade::MeshData&& mesh, const Matrix3& transformation, const UnsignedInt id, const InterleaveFlags flags) { - return transform2D(std::move(mesh), transformation, id, -1, flags); + return transform2D(Utility::move(mesh), transformation, id, -1, flags); } #endif @@ -242,7 +242,7 @@ Trade::MeshData transform3D(Trade::MeshData&& mesh, const Matrix4& transformatio (!normalAttributeId || mesh.attributeFormat(*normalAttributeId) == VertexFormat::Vector3) ) { transform3DInPlace(mesh, transformation, id, morphTargetId); - return std::move(mesh); + return Utility::move(mesh); } /* Otherwise delegate to the function that does all the copying and format @@ -252,7 +252,7 @@ Trade::MeshData transform3D(Trade::MeshData&& mesh, const Matrix4& transformatio #ifdef MAGNUM_BUILD_DEPRECATED Trade::MeshData transform3D(Trade::MeshData&& mesh, const Matrix4& transformation, const UnsignedInt id, const InterleaveFlags flags) { - return transform3D(std::move(mesh), transformation, id, -1, flags); + return transform3D(Utility::move(mesh), transformation, id, -1, flags); } #endif @@ -367,7 +367,7 @@ Trade::MeshData transformTextureCoordinates2D(Trade::MeshData&& mesh, const Matr textureCoordinateAttributeId && mesh.attributeFormat(*textureCoordinateAttributeId) == VertexFormat::Vector2 ) { transformTextureCoordinates2DInPlace(mesh, transformation, id, morphTargetId); - return std::move(mesh); + return Utility::move(mesh); } /* Otherwise delegate to the function that does all the copying and format @@ -377,7 +377,7 @@ Trade::MeshData transformTextureCoordinates2D(Trade::MeshData&& mesh, const Matr #ifdef MAGNUM_BUILD_DEPRECATED Trade::MeshData transformTextureCoordinates2D(Trade::MeshData&& mesh, const Matrix3& transformation, const UnsignedInt id, const InterleaveFlags flags) { - return transformTextureCoordinates2D(std::move(mesh), transformation, id, -1, flags); + return transformTextureCoordinates2D(Utility::move(mesh), transformation, id, -1, flags); } #endif diff --git a/src/Magnum/MeshTools/Transform.h b/src/Magnum/MeshTools/Transform.h index db1a05afd..5b9800b30 100644 --- a/src/Magnum/MeshTools/Transform.h +++ b/src/Magnum/MeshTools/Transform.h @@ -86,7 +86,7 @@ Returns transformed vectors instead of modifying them in-place. See @see @ref transform2D(), @ref transform3D(), @ref transformTextureCoordinates2D() */ template U transformVectors(const T& transformation, U vectors) { - U result(std::move(vectors)); + U result(Utility::move(vectors)); transformVectorsInPlace(transformation, result); return result; } @@ -139,7 +139,7 @@ Returns transformed points instead of modifying them in-place. See @see @ref transform2D(), @ref transform3D(), @ref transformTextureCoordinates2D() */ template U transformPoints(const T& transformation, U vectors) { - U result(std::move(vectors)); + U result(Utility::move(vectors)); transformPointsInPlace(transformation, result); return result; } diff --git a/src/Magnum/Platform/WindowlessCglApplication.cpp b/src/Magnum/Platform/WindowlessCglApplication.cpp index ead7e0be5..f3f514c91 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.cpp +++ b/src/Magnum/Platform/WindowlessCglApplication.cpp @@ -83,7 +83,7 @@ WindowlessCglContext::~WindowlessCglContext() { } WindowlessCglContext& WindowlessCglContext::operator=(WindowlessCglContext&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._pixelFormat, _pixelFormat); swap(other._context, _context); return *this; @@ -134,7 +134,7 @@ bool WindowlessCglApplication::tryCreateContext(const Configuration& configurati if(!glContext.isCreated() || !glContext.makeCurrent() || !_context.tryCreate(configuration)) return false; - _glContext = std::move(glContext); + _glContext = Utility::move(glContext); return true; } diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp index 69e4a484f..a95fbaa6e 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -638,7 +638,7 @@ WindowlessEglContext::~WindowlessEglContext() { } WindowlessEglContext& WindowlessEglContext::operator=(WindowlessEglContext&& other) noexcept { - using std::swap; + using Utility::swap; #ifndef MAGNUM_TARGET_WEBGL swap(other._sharedContext, _sharedContext); #endif @@ -740,7 +740,7 @@ bool WindowlessEglApplication::tryCreateContext(const Configuration& configurati if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate(configuration)) return false; - _glContext = std::move(glContext); + _glContext = Utility::move(glContext); return true; } diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index 381ebcfed..a472f9343 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -293,7 +293,7 @@ WindowlessGlxContext::~WindowlessGlxContext() { } WindowlessGlxContext& WindowlessGlxContext::operator=(WindowlessGlxContext&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._display, _display); swap(other._pbuffer, _pbuffer); swap(other._context, _context); @@ -346,7 +346,7 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration& configurati if(!glContext.isCreated() || !glContext.makeCurrent() || !_context.tryCreate(configuration)) return false; - _glContext = std::move(glContext); + _glContext = Utility::move(glContext); return true; } diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index b6c2c383c..cf181b665 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -278,7 +278,7 @@ WindowlessWglContext::~WindowlessWglContext() { } WindowlessWglContext& WindowlessWglContext::operator=(WindowlessWglContext&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._window, _window); swap(other._deviceContext, _deviceContext); swap(other._context, _context); @@ -331,7 +331,7 @@ bool WindowlessWglApplication::tryCreateContext(const Configuration& configurati if(!glContext.isCreated() || !glContext.makeCurrent() || !_context.tryCreate(configuration)) return false; - _glContext = std::move(glContext); + _glContext = Utility::move(glContext); return true; } diff --git a/src/Magnum/Primitives/Capsule.cpp b/src/Magnum/Primitives/Capsule.cpp index eaa31acde..9e1b8589e 100644 --- a/src/Magnum/Primitives/Capsule.cpp +++ b/src/Magnum/Primitives/Capsule.cpp @@ -102,8 +102,8 @@ Trade::MeshData capsule2DWireframe(const UnsignedInt hemisphereRings, const Unsi Trade::MeshIndexData indices{indexData}; Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::arrayView(vertexData)}; return Trade::MeshData{MeshPrimitive::Lines, - Containers::arrayAllocatorCast(std::move(indexData)), indices, - Containers::arrayAllocatorCast(std::move(vertexData)), {positions}}; + Containers::arrayAllocatorCast(Utility::move(indexData)), indices, + Containers::arrayAllocatorCast(Utility::move(vertexData)), {positions}}; } Trade::MeshData capsule3DSolid(const UnsignedInt hemisphereRings, const UnsignedInt cylinderRings, const UnsignedInt segments, const Float halfLength, const CapsuleFlags flags) { diff --git a/src/Magnum/Primitives/Circle.cpp b/src/Magnum/Primitives/Circle.cpp index da7f78e71..8da42a7d2 100644 --- a/src/Magnum/Primitives/Circle.cpp +++ b/src/Magnum/Primitives/Circle.cpp @@ -84,7 +84,7 @@ Trade::MeshData circle2DSolid(const UnsignedInt segments, const Circle2DFlags fl textureCoords[i] = positions[i]*0.5f + Vector2{0.5f}; } - return Trade::MeshData{MeshPrimitive::TriangleFan, std::move(vertexData), std::move(attributes), UnsignedInt(positions.size())}; + return Trade::MeshData{MeshPrimitive::TriangleFan, Utility::move(vertexData), Utility::move(attributes), UnsignedInt(positions.size())}; } #ifdef MAGNUM_BUILD_DEPRECATED @@ -111,7 +111,7 @@ Trade::MeshData circle2DWireframe(const UnsignedInt segments) { positions[i] = {sincos.second, sincos.first}; } - return Trade::MeshData{MeshPrimitive::LineLoop, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::LineLoop, Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(AttributeData2D), UnsignedInt(positions.size())}; } @@ -196,7 +196,7 @@ Trade::MeshData circle3DSolid(const UnsignedInt segments, const Circle3DFlags fl } return Trade::MeshData{MeshPrimitive::TriangleFan, - std::move(vertexData), std::move(attributeData)}; + Utility::move(vertexData), Utility::move(attributeData)}; } #ifdef MAGNUM_BUILD_DEPRECATED @@ -232,7 +232,7 @@ Trade::MeshData circle3DWireframe(const UnsignedInt segments) { positions[i] = {sincos.second, sincos.first, 0.0f}; } - return Trade::MeshData{MeshPrimitive::LineLoop, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::LineLoop, Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(AttributeData3DWireframe), UnsignedInt(positions.size())}; } diff --git a/src/Magnum/Primitives/Gradient.cpp b/src/Magnum/Primitives/Gradient.cpp index f2198006e..fb2d6da2a 100644 --- a/src/Magnum/Primitives/Gradient.cpp +++ b/src/Magnum/Primitives/Gradient.cpp @@ -69,7 +69,7 @@ Trade::MeshData gradient2D(const Vector2& a, const Color4& colorA, const Vector2 vertices[i].color = Math::lerp(colorA, colorB, t); } - return Trade::MeshData{MeshPrimitive::TriangleStrip, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::TriangleStrip, Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(Attributes2D)}; } @@ -126,7 +126,7 @@ Trade::MeshData gradient3D(const Vector3& a, const Color4& colorA, const Vector3 vertices[i].color = Math::lerp(colorA, colorB, t); } - return Trade::MeshData{MeshPrimitive::TriangleStrip, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::TriangleStrip, Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(Attributes3D)}; } diff --git a/src/Magnum/Primitives/Grid.cpp b/src/Magnum/Primitives/Grid.cpp index 1a7c137be..c7e8e21f9 100644 --- a/src/Magnum/Primitives/Grid.cpp +++ b/src/Magnum/Primitives/Grid.cpp @@ -125,8 +125,8 @@ Trade::MeshData grid3DSolid(const Vector2i& subdivisions, const GridFlags flags) CORRADE_INTERNAL_ASSERT(attributeOffset == stride); return Trade::MeshData{MeshPrimitive::Triangles, - std::move(indexData), Trade::MeshIndexData{indices}, - std::move(vertexData), std::move(attributes)}; + Utility::move(indexData), Trade::MeshIndexData{indices}, + Utility::move(vertexData), Utility::move(attributes)}; } namespace { @@ -176,8 +176,8 @@ Trade::MeshData grid3DWireframe(const Vector2i& subdivisions) { } return Trade::MeshData{MeshPrimitive::Lines, - std::move(indexData), Trade::MeshIndexData{indices}, - std::move(vertexData), + Utility::move(indexData), Trade::MeshIndexData{indices}, + Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(AttributeData3DWireframe), UnsignedInt(vertexCount.product())}; } diff --git a/src/Magnum/Primitives/Icosphere.cpp b/src/Magnum/Primitives/Icosphere.cpp index 6ee4791e7..9d847459a 100644 --- a/src/Magnum/Primitives/Icosphere.cpp +++ b/src/Magnum/Primitives/Icosphere.cpp @@ -138,8 +138,8 @@ Trade::MeshData icosphereSolid(const UnsignedInt subdivisions) { for(std::size_t i = 0; i != positions.size(); ++i) normals[i] = positions[i]; - return Trade::MeshData{MeshPrimitive::Triangles, std::move(indexData), - Trade::MeshIndexData{indices}, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::Triangles, Utility::move(indexData), + Trade::MeshIndexData{indices}, Utility::move(vertexData), {Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals}}}; } diff --git a/src/Magnum/Primitives/Implementation/Spheroid.cpp b/src/Magnum/Primitives/Implementation/Spheroid.cpp index 92c304533..dcdc1fca0 100644 --- a/src/Magnum/Primitives/Implementation/Spheroid.cpp +++ b/src/Magnum/Primitives/Implementation/Spheroid.cpp @@ -272,8 +272,8 @@ Trade::MeshData Spheroid::finalize() { CORRADE_INTERNAL_ASSERT(attributeOffset == _attributeCount); return Trade::MeshData{MeshPrimitive::Triangles, - Containers::arrayAllocatorCast(std::move(_indexData)), - indices, std::move(_vertexData), std::move(attributes)}; + Containers::arrayAllocatorCast(Utility::move(_indexData)), + indices, Utility::move(_vertexData), Utility::move(attributes)}; } }}} diff --git a/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp b/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp index b833c3b3e..4570560ae 100644 --- a/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp +++ b/src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp @@ -148,8 +148,8 @@ Trade::MeshData WireframeSpheroid::finalize() { Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::arrayView(_vertexData)}; const UnsignedInt vertexCount = _vertexData.size(); return Trade::MeshData{MeshPrimitive::Lines, - Containers::arrayAllocatorCast(std::move(_indexData)), indices, - Containers::arrayAllocatorCast(std::move(_vertexData)), + Containers::arrayAllocatorCast(Utility::move(_indexData)), indices, + Containers::arrayAllocatorCast(Utility::move(_vertexData)), Trade::meshAttributeDataNonOwningArray(AttributeData), vertexCount}; } diff --git a/src/Magnum/Primitives/Line.cpp b/src/Magnum/Primitives/Line.cpp index 095642be2..379400b89 100644 --- a/src/Magnum/Primitives/Line.cpp +++ b/src/Magnum/Primitives/Line.cpp @@ -46,7 +46,7 @@ Trade::MeshData line2D(const Vector2& a, const Vector2& b) { positions[0] = a; positions[1] = b; - return Trade::MeshData{MeshPrimitive::Lines, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::Lines, Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(Attributes2D)}; } @@ -65,7 +65,7 @@ Trade::MeshData line3D(const Vector3& a, const Vector3& b) { positions[0] = a; positions[1] = b; - return Trade::MeshData{MeshPrimitive::Lines, std::move(vertexData), + return Trade::MeshData{MeshPrimitive::Lines, Utility::move(vertexData), Trade::meshAttributeDataNonOwningArray(Attributes3D)}; } diff --git a/src/Magnum/Primitives/Plane.cpp b/src/Magnum/Primitives/Plane.cpp index 307bf93d1..5dce2ef7f 100644 --- a/src/Magnum/Primitives/Plane.cpp +++ b/src/Magnum/Primitives/Plane.cpp @@ -137,7 +137,7 @@ Trade::MeshData planeSolid(const PlaneFlags flags) { } return Trade::MeshData{MeshPrimitive::TriangleStrip, - std::move(vertexData), std::move(attributeData)}; + Utility::move(vertexData), Utility::move(attributeData)}; } #ifdef MAGNUM_BUILD_DEPRECATED diff --git a/src/Magnum/SceneTools/Copy.cpp b/src/Magnum/SceneTools/Copy.cpp index b941bfcaa..0eb7671a8 100644 --- a/src/Magnum/SceneTools/Copy.cpp +++ b/src/Magnum/SceneTools/Copy.cpp @@ -60,7 +60,7 @@ Trade::SceneData copy(Trade::SceneData&& scene) { the original array in its entirety */ Containers::Array fieldData; if(!originalFieldData.deleter() && (scene.dataFlags() & Trade::DataFlag::Owned)) { - fieldData = std::move(originalFieldData); + fieldData = Utility::move(originalFieldData); /* Otherwise we have to allocate a new one and re-route the fields to a potentially different data array */ @@ -135,7 +135,7 @@ Trade::SceneData copy(Trade::SceneData&& scene) { } return Trade::SceneData{scene.mappingType(), scene.mappingBound(), - std::move(data), std::move(fieldData), scene.importerState()}; + Utility::move(data), Utility::move(fieldData), scene.importerState()}; } }} diff --git a/src/Magnum/SceneTools/Filter.cpp b/src/Magnum/SceneTools/Filter.cpp index 8d1fb6c75..c364a66fa 100644 --- a/src/Magnum/SceneTools/Filter.cpp +++ b/src/Magnum/SceneTools/Filter.cpp @@ -48,7 +48,7 @@ Trade::SceneData filterFields(const Trade::SceneData& scene, const Containers::B Utility::copyMasked(scene.fieldData(), fieldsToKeep, filtered); return Trade::SceneData{scene.mappingType(), scene.mappingBound(), - {}, scene.data(), std::move(filtered)}; + {}, scene.data(), Utility::move(filtered)}; } Trade::SceneData filterOnlyFields(const Trade::SceneData& scene, const Containers::ArrayView fields) { diff --git a/src/Magnum/SceneTools/Implementation/combine.h b/src/Magnum/SceneTools/Implementation/combine.h index 80c53d5d5..225f3b5f8 100644 --- a/src/Magnum/SceneTools/Implementation/combine.h +++ b/src/Magnum/SceneTools/Implementation/combine.h @@ -388,7 +388,7 @@ inline Trade::SceneData combineFields(const Trade::SceneMappingType mappingType, } } - return Trade::SceneData{mappingType, mappingBound, std::move(outData), std::move(outFields)}; + return Trade::SceneData{mappingType, mappingBound, Utility::move(outData), Utility::move(outFields)}; } }}} diff --git a/src/Magnum/SceneTools/Implementation/sceneConverterUtilities.h b/src/Magnum/SceneTools/Implementation/sceneConverterUtilities.h index 2f56590c1..0b3100f36 100644 --- a/src/Magnum/SceneTools/Implementation/sceneConverterUtilities.h +++ b/src/Magnum/SceneTools/Implementation/sceneConverterUtilities.h @@ -288,7 +288,7 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility if(args.isSet("object-hierarchy") && scene->hasField(Trade::SceneField::Parent)) info.childrenDepthFirst = SceneTools::childrenDepthFirst(*scene); - arrayAppend(sceneInfos, std::move(info)); + arrayAppend(sceneInfos, Utility::move(info)); } } @@ -327,7 +327,7 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility animation->track(j).size()); } - arrayAppend(animationInfos, std::move(info)); + arrayAppend(animationInfos, Utility::move(info)); } /* Skin properties */ @@ -350,7 +350,7 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility info.name = importer.skin2DName(i); info.jointCount = skin->joints().size(); - arrayAppend(skinInfos, std::move(info)); + arrayAppend(skinInfos, Utility::move(info)); } for(UnsignedInt i = 0; i != importer.skin3DCount(); ++i) { @@ -370,7 +370,7 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility info.name = importer.skin3DName(i); info.jointCount = skin->joints().size(); - arrayAppend(skinInfos, std::move(info)); + arrayAppend(skinInfos, Utility::move(info)); } } @@ -390,9 +390,9 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility LightInfo info{}; info.light = i; info.name = importer.lightName(i); - info.data = *std::move(light); + info.data = *Utility::move(light); - arrayAppend(lightInfos, std::move(info)); + arrayAppend(lightInfos, Utility::move(info)); } /* Camera properties */ @@ -411,9 +411,9 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility CameraInfo info{}; info.camera = i; info.name = importer.cameraName(i); - info.data = *std::move(camera); + info.data = *Utility::move(camera); - arrayAppend(cameraInfos, std::move(info)); + arrayAppend(cameraInfos, Utility::move(info)); } /* Material properties, together with how much is each texture shared @@ -454,9 +454,9 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility MaterialInfo info{}; info.material = i; info.name = importer.materialName(i); - info.data = *std::move(material); + info.data = *Utility::move(material); - arrayAppend(materialInfos, std::move(info)); + arrayAppend(materialInfos, Utility::move(info)); } } @@ -549,7 +549,7 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility bounds); } - arrayAppend(meshInfos, std::move(info)); + arrayAppend(meshInfos, Utility::move(info)); } } @@ -597,9 +597,9 @@ bool printInfo(const Debug::Flags useColor, const bool useColor24, const Utility TextureInfo info{}; info.texture = i; info.name = importer.textureName(i); - info.data = *std::move(texture); + info.data = *Utility::move(texture); - arrayAppend(textureInfos, std::move(info)); + arrayAppend(textureInfos, Utility::move(info)); } } diff --git a/src/Magnum/SceneTools/Test/CopyTest.cpp b/src/Magnum/SceneTools/Test/CopyTest.cpp index 21b177b97..4ecff7e29 100644 --- a/src/Magnum/SceneTools/Test/CopyTest.cpp +++ b/src/Magnum/SceneTools/Test/CopyTest.cpp @@ -229,7 +229,7 @@ void CopyTest::rvalueDataFieldsOwned() { const Trade::SceneFieldData* originalFields = fields; Trade::SceneData copy = SceneTools::copy(Trade::SceneData{Trade::SceneMappingType::UnsignedShort, 12, - std::move(data), std::move(fields)}); + Utility::move(data), Utility::move(fields)}); CORRADE_COMPARE(copy.mappingType(), Trade::SceneMappingType::UnsignedShort); CORRADE_COMPARE(copy.mappingBound(), 12); @@ -267,7 +267,7 @@ void CopyTest::rvalueDataOwned() { }; Trade::SceneData copy = SceneTools::copy(Trade::SceneData{Trade::SceneMappingType::UnsignedShort, 12, - std::move(data), Trade::sceneFieldDataNonOwningArray(fields)}); + Utility::move(data), Trade::sceneFieldDataNonOwningArray(fields)}); CORRADE_COMPARE(copy.mappingType(), Trade::SceneMappingType::UnsignedShort); CORRADE_COMPARE(copy.mappingBound(), 12); @@ -304,7 +304,7 @@ void CopyTest::rvalueFieldsOwned() { const Trade::SceneFieldData* originalFields = fields; Trade::SceneData copy = SceneTools::copy(Trade::SceneData{Trade::SceneMappingType::UnsignedShort, 12, - Trade::DataFlag::ExternallyOwned, data, std::move(fields)}); + Trade::DataFlag::ExternallyOwned, data, Utility::move(fields)}); CORRADE_COMPARE(copy.mappingType(), Trade::SceneMappingType::UnsignedShort); CORRADE_COMPARE(copy.mappingBound(), 12); diff --git a/src/Magnum/SceneTools/Test/SceneConverterImplementationTest.cpp b/src/Magnum/SceneTools/Test/SceneConverterImplementationTest.cpp index 772b6c8d3..442948d88 100644 --- a/src/Magnum/SceneTools/Test/SceneConverterImplementationTest.cpp +++ b/src/Magnum/SceneTools/Test/SceneConverterImplementationTest.cpp @@ -278,7 +278,7 @@ void SceneConverterImplementationTest::infoScenesObjects() { Utility::copy({2, -1, 1, 2, 5}, parents); Utility::copy({2, 0, 2, 1}, meshMapping); /* No need to fill the other data, zero-init is fine */ - return Trade::SceneData{Trade::SceneMappingType::UnsignedInt, 6, std::move(data), { + return Trade::SceneData{Trade::SceneMappingType::UnsignedInt, 6, Utility::move(data), { Trade::SceneFieldData{_omitParent ? Trade::sceneFieldCustom(0) : Trade::SceneField::Parent, parentMapping, parents}, Trade::SceneFieldData{Trade::SceneField::Mesh, meshMapping, meshes, Trade::SceneFieldFlag::OrderedMapping}, }}; @@ -359,7 +359,7 @@ void SceneConverterImplementationTest::infoAnimations() { {ValueInit, 3, visibility}, }; Utility::copy({0.5f, 1.0f, 1.25f}, time); - return Trade::AnimationData{std::move(data), { + return Trade::AnimationData{Utility::move(data), { Trade::AnimationTrackData{Trade::AnimationTrackTarget::Translation2D, 17, time, translation, Animation::Interpolation::Linear, Animation::Extrapolation::DefaultConstructed, Animation::Extrapolation::Constant}, Trade::AnimationTrackData{Trade::AnimationTrackTarget::Rotation2D, 17, time, rotation, Animation::Interpolation::Constant, Animation::Extrapolation::Extrapolated}, Trade::AnimationTrackData{Trade::animationTrackTargetCustom(333), 666, time, visibility, Animation::Interpolation::Constant, Animation::Extrapolation::Constant}, @@ -710,7 +710,7 @@ void SceneConverterImplementationTest::infoMeshes() { {NoInit, 250, positions}, {NoInit, 250, tangents}, }; - return Trade::MeshData{MeshPrimitive::Triangles, std::move(data), { + return Trade::MeshData{MeshPrimitive::Triangles, Utility::move(data), { Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, Trade::MeshAttributeData{Trade::MeshAttribute::Tangent, tangents}, }}; @@ -726,7 +726,7 @@ void SceneConverterImplementationTest::infoMeshes() { {NoInit, 135, triangleCount}, {NoInit, 135, vertexCount}, }; - return Trade::MeshData{MeshPrimitive::Meshlets, std::move(data), { + return Trade::MeshData{MeshPrimitive::Meshlets, Utility::move(data), { Trade::MeshAttributeData{Trade::meshAttributeCustom(25), vertices}, Trade::MeshAttributeData{Trade::meshAttributeCustom(26), indices}, Trade::MeshAttributeData{Trade::meshAttributeCustom(37), triangleCount}, diff --git a/src/Magnum/SceneTools/Test/SceneConverterTest.cpp b/src/Magnum/SceneTools/Test/SceneConverterTest.cpp index 4b59ffa1f..59afd4a2b 100644 --- a/src/Magnum/SceneTools/Test/SceneConverterTest.cpp +++ b/src/Magnum/SceneTools/Test/SceneConverterTest.cpp @@ -1358,7 +1358,7 @@ Containers::Pair call(const Containers::StringIterable const Containers::Optional output = Utility::Path::readString(outputFilename); CORRADE_VERIFY(output); - return {success, std::move(*output)}; + return {success, Utility::move(*output)}; } #endif diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index 9b640888d..864a06927 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -396,7 +396,7 @@ template bool runImageConverters(PluginManager::Manager< of converting them (which needs AbstractImageConverter to be reworked around ImageData) */ if(Containers::Optional> converted = imageConverter->convert(*image)) { - image = std::move(converted); + image = Utility::move(converted); } else if(passthroughOnConversionFailure) { Warning{} << "Cannot process" << dimensions << Debug::nospace << "D image" << i << "with" << imageConverterName << Debug::nospace << ", passing the original through"; } else { @@ -813,7 +813,7 @@ well, the IDs reference attributes of the first mesh.)") return 1; } - arrayAppend(meshes, *std::move(meshToConcatenate)); + arrayAppend(meshes, *Utility::move(meshToConcatenate)); } /* If there's a scene, use it to flatten mesh hierarchy. If not, @@ -845,7 +845,7 @@ well, the IDs reference attributes of the first mesh.)") meshes[meshesMaterials[i].second().first()], transformations[i])); } } - meshes = std::move(flattenedMeshes); + meshes = Utility::move(flattenedMeshes); } { @@ -883,7 +883,7 @@ well, the IDs reference attributes of the first mesh.)") const UnsignedInt vertexCount = mesh->vertexCount(); mesh = Trade::MeshData{mesh->primitive(), mesh->releaseIndexData(), indices, - mesh->releaseVertexData(), std::move(attributes), + mesh->releaseVertexData(), Utility::move(attributes), vertexCount}; } @@ -892,7 +892,7 @@ well, the IDs reference attributes of the first mesh.)") /** @todo might be useful to have this split out of the file and tested directly if the complexity grows even further */ struct SingleMeshImporter: Trade::AbstractImporter { - explicit SingleMeshImporter(Trade::MeshData&& mesh_, Containers::String&& name, Trade::AbstractImporter& original): mesh{std::move(mesh_)}, name{std::move(name)} { + explicit SingleMeshImporter(Trade::MeshData&& mesh_, Containers::String&& name, Trade::AbstractImporter& original): mesh{Utility::move(mesh_)}, name{Utility::move(name)} { for(UnsignedInt i = 0; i != mesh.attributeCount(); ++i) { const Trade::MeshAttribute attributeName = mesh.attributeName(i); if(!isMeshAttributeCustom(attributeName)) continue; @@ -934,8 +934,8 @@ well, the IDs reference attributes of the first mesh.)") /** @todo would it make sense for emplace() to first construct and only then delete so I wouldn't need to juggle the previous value manually? */ - Containers::Pointer previousImporter = std::move(importer); - importer.emplace(*std::move(mesh), + Containers::Pointer previousImporter = Utility::move(importer); + importer.emplace(*Utility::move(mesh), /* Propagate the name only in case of a single mesh, for concatenation it wouldn't make sense */ args.value("mesh") ? previousImporter->meshName(args.value("mesh")) : Containers::String{}, @@ -971,7 +971,7 @@ well, the IDs reference attributes of the first mesh.)") if(!runImageConverters(imageConverterManager, args, i, image)) return 1; - arrayAppend(images2D, *std::move(image)); + arrayAppend(images2D, *Utility::move(image)); } for(UnsignedInt i = 0; i != importer->image3DCount(); ++i) { @@ -991,7 +991,7 @@ well, the IDs reference attributes of the first mesh.)") if(!runImageConverters(imageConverterManager, args, i, image)) return 1; - arrayAppend(images3D, *std::move(image)); + arrayAppend(images3D, *Utility::move(image)); } } @@ -1030,10 +1030,10 @@ well, the IDs reference attributes of the first mesh.)") and texcoords? ugh... */ if(fuzzy) { Trade::Implementation::Duration d{conversionTime}; - mesh = MeshTools::removeDuplicatesFuzzy(*std::move(mesh), args.value("remove-duplicate-vertices-fuzzy")); + mesh = MeshTools::removeDuplicatesFuzzy(*Utility::move(mesh), args.value("remove-duplicate-vertices-fuzzy")); } else { Trade::Implementation::Duration d{conversionTime}; - mesh = MeshTools::removeDuplicates(*std::move(mesh)); + mesh = MeshTools::removeDuplicates(*Utility::move(mesh)); } if(args.isSet("verbose")) { @@ -1080,7 +1080,7 @@ well, the IDs reference attributes of the first mesh.)") /** @todo handle mesh levels here, once any plugin is capable of converting them */ if(Containers::Optional converted = meshConverter->convert(*mesh)) { - mesh = std::move(converted); + mesh = Utility::move(converted); } else if(passthroughOnConversionFailure) { Warning{} << "Cannot process mesh" << i << "with" << meshConverterName << Debug::nospace << ", passing the original through"; } else { @@ -1089,7 +1089,7 @@ well, the IDs reference attributes of the first mesh.)") } } - arrayAppend(meshes, *std::move(mesh)); + arrayAppend(meshes, *Utility::move(mesh)); } } @@ -1122,7 +1122,7 @@ well, the IDs reference attributes of the first mesh.)") CORRADE_INTERNAL_ASSERT(material); } - arrayAppend(materials, *std::move(material)); + arrayAppend(materials, *Utility::move(material)); } } diff --git a/src/Magnum/ShaderTools/AbstractConverter.cpp b/src/Magnum/ShaderTools/AbstractConverter.cpp index 85fd28591..b23c94222 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.cpp +++ b/src/Magnum/ShaderTools/AbstractConverter.cpp @@ -277,7 +277,7 @@ AbstractConverter::convertDataToData(const Stage stage, const Containers::ArrayV /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::OptionalButAlsoArray{std::move(out)}; + return Implementation::OptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -425,7 +425,7 @@ AbstractConverter::convertFileToData(const Stage stage, const Containers::String /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::OptionalButAlsoArray{std::move(out)}; + return Implementation::OptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -469,7 +469,7 @@ AbstractConverter::linkDataToData(const Containers::ArrayView{std::move(out)}; + return Implementation::OptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -617,7 +617,7 @@ bool AbstractConverter::doLinkFilesToFile(const Containers::ArrayView{std::move(out)}; + return Implementation::OptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -714,7 +714,7 @@ Containers::Optional> AbstractConverter::doLinkFilesToDa return {}; } - fileData[i] = *std::move(data); + fileData[i] = *Utility::move(data); } /** @todo merge the allocations once we have an ArrayTuple */ diff --git a/src/Magnum/ShaderTools/AbstractConverter.h b/src/Magnum/ShaderTools/AbstractConverter.h index b95242186..9fa007fe3 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.h +++ b/src/Magnum/ShaderTools/AbstractConverter.h @@ -289,9 +289,9 @@ namespace Implementation { seems silly. */ template struct OptionalButAlsoArray: Containers::Optional> { /*implicit*/ OptionalButAlsoArray() = default; - /*implicit*/ OptionalButAlsoArray(Containers::Optional>&& optional): Containers::Optional>{std::move(optional)} {} + /*implicit*/ OptionalButAlsoArray(Containers::Optional>&& optional): Containers::Optional>{Utility::move(optional)} {} CORRADE_DEPRECATED("use Containers::Optional> instead") /*implicit*/ operator Containers::Array() && { - return *this ? Containers::Array{std::move(**this)} : nullptr; + return *this ? Containers::Array{Utility::move(**this)} : nullptr; } }; } diff --git a/src/Magnum/ShaderTools/shaderconverter.cpp b/src/Magnum/ShaderTools/shaderconverter.cpp index f18bc90ce..003733c54 100644 --- a/src/Magnum/ShaderTools/shaderconverter.cpp +++ b/src/Magnum/ShaderTools/shaderconverter.cpp @@ -505,7 +505,7 @@ see documentation of a particular converter for more information.)") } if(Containers::Optional> out = converter->convertFileToData(ShaderTools::Stage::Unspecified, args.arrayValue("input", 0))) { - data = *std::move(out); + data = *Utility::move(out); } else { Error{} << "Cannot convert" << args.arrayValue("input", 0); return 20; /* same code as the same message below */ @@ -589,7 +589,7 @@ see documentation of a particular converter for more information.)") /* Linking */ if(args.isSet("link")) { if(Containers::Optional> out = converter->linkFilesToData(linkInputs)) { - data = *std::move(out); + data = *Utility::move(out); } else { Error{} << "Cannot link" << args.arrayValue("input", 0) << "and others to" << args.value("output"); return 19; @@ -598,7 +598,7 @@ see documentation of a particular converter for more information.)") /* Converting */ } else { if(Containers::Optional> out = converter->convertFileToData(ShaderTools::Stage::Unspecified, args.arrayValue("input", 0))) { - data = *std::move(out); + data = *Utility::move(out); } else { Error{} << "Cannot convert" << args.arrayValue("input", 0); return 20; @@ -615,7 +615,7 @@ see documentation of a particular converter for more information.)") /* Subsequent operations are always a conversion, not link */ if(Containers::Optional> out = converter->convertDataToData(ShaderTools::Stage::Unspecified, data)) { - data = *std::move(out); + data = *Utility::move(out); } else { Error{} << "Cannot convert shader data"; return 21; diff --git a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp index 1a5bed8d7..7c98bcb6e 100644 --- a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp +++ b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp @@ -206,7 +206,7 @@ template typename DistanceFieldVectorGL::Com #endif out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_GLES) || (!defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) , version #endif @@ -229,7 +229,7 @@ template typename DistanceFieldVectorGL::Com #endif #endif -template DistanceFieldVectorGL::DistanceFieldVectorGL(CompileState&& state): DistanceFieldVectorGL{static_cast(std::move(state))} { +template DistanceFieldVectorGL::DistanceFieldVectorGL(CompileState&& state): DistanceFieldVectorGL{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/FlatGL.cpp b/src/Magnum/Shaders/FlatGL.cpp index 8c398c9e5..f5ce223a9 100644 --- a/src/Magnum/Shaders/FlatGL.cpp +++ b/src/Magnum/Shaders/FlatGL.cpp @@ -380,7 +380,7 @@ template typename FlatGL::CompileState FlatG out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_GLES) || (!defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) , version #endif @@ -403,7 +403,7 @@ template typename FlatGL::CompileState FlatG #endif #endif -template FlatGL::FlatGL(CompileState&& state): FlatGL{static_cast(std::move(state))} { +template FlatGL::FlatGL(CompileState&& state): FlatGL{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/LineGL.cpp b/src/Magnum/Shaders/LineGL.cpp index 2e35de76e..1edc746a8 100644 --- a/src/Magnum/Shaders/LineGL.cpp +++ b/src/Magnum/Shaders/LineGL.cpp @@ -245,14 +245,14 @@ template typename LineGL::CompileState LineG out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_GLES) || !defined(MAGNUM_TARGET_WEBGL) , version #endif }; } -template LineGL::LineGL(CompileState&& state): LineGL{static_cast(std::move(state))} { +template LineGL::LineGL(CompileState&& state): LineGL{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/MeshVisualizerGL.cpp b/src/Magnum/Shaders/MeshVisualizerGL.cpp index 01541c340..164fa9435 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.cpp +++ b/src/Magnum/Shaders/MeshVisualizerGL.cpp @@ -754,7 +754,7 @@ MeshVisualizerGL2D::CompileState MeshVisualizerGL2D::compile(const Configuration out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) , geom ? &*geom : nullptr #endif @@ -780,7 +780,7 @@ MeshVisualizerGL2D::CompileState MeshVisualizerGL2D::compile(const Flags flags, #endif #endif -MeshVisualizerGL2D::MeshVisualizerGL2D(CompileState&& state): MeshVisualizerGL2D{static_cast(std::move(state))} { +MeshVisualizerGL2D::MeshVisualizerGL2D(CompileState&& state): MeshVisualizerGL2D{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ @@ -1315,7 +1315,7 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Configuration out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) , geom ? &*geom : nullptr #endif @@ -1341,7 +1341,7 @@ MeshVisualizerGL3D::CompileState MeshVisualizerGL3D::compile(const Flags flags, #endif #endif -MeshVisualizerGL3D::MeshVisualizerGL3D(CompileState&& state): MeshVisualizerGL3D{static_cast(std::move(state))} { +MeshVisualizerGL3D::MeshVisualizerGL3D(CompileState&& state): MeshVisualizerGL3D{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/PhongGL.cpp b/src/Magnum/Shaders/PhongGL.cpp index 05e89a117..2d5113859 100644 --- a/src/Magnum/Shaders/PhongGL.cpp +++ b/src/Magnum/Shaders/PhongGL.cpp @@ -407,7 +407,7 @@ PhongGL::CompileState PhongGL::compile(const Configuration& configuration) { } #ifndef MAGNUM_TARGET_GLES if(!(configuration.flags() >= Flag::UniformBuffers) && configuration.lightCount()) - frag.addSource(std::move(lightInitializer)); + frag.addSource(Utility::move(lightInitializer)); #endif frag.addSource(rs.getString("generic.glsl"_s)) .addSource(rs.getString("Phong.frag"_s)) @@ -471,7 +471,7 @@ PhongGL::CompileState PhongGL::compile(const Configuration& configuration) { out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_GLES) || (!defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) , version #endif @@ -500,7 +500,7 @@ PhongGL::CompileState PhongGL::compile(const Flags flags, const UnsignedInt ligh #endif #endif -PhongGL::PhongGL(CompileState&& state): PhongGL{static_cast(std::move(state))} { +PhongGL::PhongGL(CompileState&& state): PhongGL{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index ec1d28712..12596ab97 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -434,7 +434,7 @@ template void DistanceFieldVectorGLTest::constructAsync( while(!state.isLinkFinished()) Utility::System::sleep(100); - DistanceFieldVectorGL shader{std::move(state)}; + DistanceFieldVectorGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), DistanceFieldVectorGL2D::Flag::TextureTransformation); CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.id()); @@ -522,7 +522,7 @@ template void DistanceFieldVectorGLTest::constructUnifor while(!state.isLinkFinished()) Utility::System::sleep(100); - DistanceFieldVectorGL shader{std::move(state)}; + DistanceFieldVectorGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), DistanceFieldVectorGL2D::Flag::UniformBuffers); CORRADE_COMPARE(shader.materialCount(), 16); CORRADE_COMPARE(shader.drawCount(), 48); @@ -549,13 +549,13 @@ template void DistanceFieldVectorGLTest::constructMove() MAGNUM_VERIFY_NO_GL_ERROR(); - DistanceFieldVectorGL b{std::move(a)}; + DistanceFieldVectorGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), DistanceFieldVectorGL::Flag::TextureTransformation); CORRADE_VERIFY(!a.id()); DistanceFieldVectorGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), DistanceFieldVectorGL::Flag::TextureTransformation); CORRADE_VERIFY(!b.id()); @@ -579,7 +579,7 @@ template void DistanceFieldVectorGLTest::constructMoveUn MAGNUM_VERIFY_NO_GL_ERROR(); - DistanceFieldVectorGL b{std::move(a)}; + DistanceFieldVectorGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), DistanceFieldVectorGL::Flag::UniformBuffers); CORRADE_COMPARE(b.materialCount(), 2); @@ -587,7 +587,7 @@ template void DistanceFieldVectorGLTest::constructMoveUn CORRADE_VERIFY(!a.id()); DistanceFieldVectorGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), DistanceFieldVectorGL::Flag::UniformBuffers); CORRADE_COMPARE(c.materialCount(), 2); diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 6007f897e..11cc13dbc 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -1252,7 +1252,7 @@ template void FlatGLTest::constructAsync() { while(!state.isLinkFinished()) Utility::System::sleep(100); - FlatGL shader{std::move(state)}; + FlatGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), FlatGL2D::Flag::Textured|FlatGL2D::Flag::TextureTransformation); CORRADE_VERIFY(shader.id()); @@ -1354,7 +1354,7 @@ template void FlatGLTest::constructUniformBuffersAsync() while(!state.isLinkFinished()) Utility::System::sleep(100); - FlatGL shader{std::move(state)}; + FlatGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), FlatGL2D::Flag::UniformBuffers|FlatGL2D::Flag::AlphaMask); CORRADE_COMPARE(shader.materialCount(), 5); CORRADE_COMPARE(shader.drawCount(), 36); @@ -1387,13 +1387,13 @@ template void FlatGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); - FlatGL b{std::move(a)}; + FlatGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), FlatGL::Flag::Textured); CORRADE_VERIFY(!a.id()); FlatGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), FlatGL::Flag::Textured); CORRADE_VERIFY(!b.id()); @@ -1420,7 +1420,7 @@ template void FlatGLTest::constructMoveUniformBuffers() MAGNUM_VERIFY_NO_GL_ERROR(); - FlatGL b{std::move(a)}; + FlatGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), FlatGL::Flag::UniformBuffers); CORRADE_COMPARE(b.materialCount(), 2); @@ -1431,7 +1431,7 @@ template void FlatGLTest::constructMoveUniformBuffers() CORRADE_VERIFY(!a.id()); FlatGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), FlatGL::Flag::UniformBuffers); CORRADE_COMPARE(c.materialCount(), 2); diff --git a/src/Magnum/Shaders/Test/GLShaderWrapperGLTest.cpp b/src/Magnum/Shaders/Test/GLShaderWrapperGLTest.cpp index ca8365327..a7612a821 100644 --- a/src/Magnum/Shaders/Test/GLShaderWrapperGLTest.cpp +++ b/src/Magnum/Shaders/Test/GLShaderWrapperGLTest.cpp @@ -62,7 +62,7 @@ void GLShaderWrapperGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Implementation::GLShaderWrapper shader{std::move(glShader)}; + Implementation::GLShaderWrapper shader{Utility::move(glShader)}; MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(shader.id, id); CORRADE_COMPARE(shader.type, GL_FRAGMENT_SHADER); @@ -80,13 +80,13 @@ void GLShaderWrapperGLTest::constructMove() { GL::Version::GLES300, #endif GL::Shader::Type::Fragment}; - Implementation::GLShaderWrapper a{std::move(glShaderA)}; + Implementation::GLShaderWrapper a{Utility::move(glShaderA)}; GLuint id = a.id; MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - Implementation::GLShaderWrapper b{std::move(a)}; + Implementation::GLShaderWrapper b{Utility::move(a)}; CORRADE_VERIFY(!a.id); CORRADE_COMPARE(b.id, id); CORRADE_COMPARE(b.type, GL_FRAGMENT_SHADER); @@ -98,10 +98,10 @@ void GLShaderWrapperGLTest::constructMove() { GL::Version::GLES200, #endif GL::Shader::Type::Vertex}; - Implementation::GLShaderWrapper c{std::move(glShaderB)}; + Implementation::GLShaderWrapper c{Utility::move(glShaderB)}; GLuint cId = c.id; - c = std::move(b); + c = Utility::move(b); MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id, cId); @@ -121,7 +121,7 @@ void GLShaderWrapperGLTest::convert() { GL::Version::GLES300, #endif GL::Shader::Type::Fragment}; - Implementation::GLShaderWrapper shader{std::move(glShader)}; + Implementation::GLShaderWrapper shader{Utility::move(glShader)}; GLuint id = shader.id; MAGNUM_VERIFY_NO_GL_ERROR(); @@ -148,13 +148,13 @@ void GLShaderWrapperGLTest::convertRvalue() { GL::Version::GLES300, #endif GL::Shader::Type::Fragment}; - Implementation::GLShaderWrapper shader{std::move(glShader)}; + Implementation::GLShaderWrapper shader{Utility::move(glShader)}; GLuint id = shader.id; MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); - GL::Shader glShader2 = std::move(shader); + GL::Shader glShader2 = Utility::move(shader); MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR(); diff --git a/src/Magnum/Shaders/Test/LineGLTest.cpp b/src/Magnum/Shaders/Test/LineGLTest.cpp index 0eac34084..1d1ca5783 100644 --- a/src/Magnum/Shaders/Test/LineGLTest.cpp +++ b/src/Magnum/Shaders/Test/LineGLTest.cpp @@ -606,7 +606,7 @@ template void LineGLTest::constructAsync() { while(!state.isLinkFinished()) Utility::System::sleep(100); - LineGL shader{std::move(state)}; + LineGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), LineGL2D::Flag::VertexColor); CORRADE_COMPARE(shader.capStyle(), LineCapStyle::Butt); CORRADE_COMPARE(shader.joinStyle(), LineJoinStyle::Bevel); @@ -708,7 +708,7 @@ template void LineGLTest::constructUniformBuffersAsync() while(!state.isLinkFinished()) Utility::System::sleep(100); - LineGL shader{std::move(state)}; + LineGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), LineGL2D::Flag::UniformBuffers|LineGL2D::Flag::VertexColor); CORRADE_COMPARE(shader.capStyle(), LineCapStyle::Butt); CORRADE_COMPARE(shader.joinStyle(), LineJoinStyle::Bevel); @@ -740,13 +740,13 @@ template void LineGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); - LineGL b{std::move(a)}; + LineGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), LineGL::Flag::VertexColor); CORRADE_VERIFY(!a.id()); LineGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), LineGL::Flag::VertexColor); CORRADE_VERIFY(!b.id()); @@ -769,7 +769,7 @@ template void LineGLTest::constructMoveUniformBuffers() MAGNUM_VERIFY_NO_GL_ERROR(); - LineGL b{std::move(a)}; + LineGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), LineGL::Flag::UniformBuffers); CORRADE_COMPARE(b.materialCount(), 2); @@ -777,7 +777,7 @@ template void LineGLTest::constructMoveUniformBuffers() CORRADE_VERIFY(!a.id()); LineGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), LineGL::Flag::UniformBuffers); CORRADE_COMPARE(c.materialCount(), 2); diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index 16904b7d1..37d7d8f9d 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -1969,7 +1969,7 @@ void MeshVisualizerGLTest::constructAsync2D() { while(!state.isLinkFinished()) Utility::System::sleep(100); - MeshVisualizerGL2D shader{std::move(state)}; + MeshVisualizerGL2D shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader); CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.id()); @@ -1994,7 +1994,7 @@ void MeshVisualizerGLTest::constructAsync3D() { while(!state.isLinkFinished()) Utility::System::sleep(100); - MeshVisualizerGL3D shader{std::move(state)}; + MeshVisualizerGL3D shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader); CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.id()); @@ -2228,7 +2228,7 @@ void MeshVisualizerGLTest::constructUniformBuffersAsync2D() { while(!state.isLinkFinished()) Utility::System::sleep(100); - MeshVisualizerGL2D shader{std::move(state)}; + MeshVisualizerGL2D shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), MeshVisualizerGL2D::Flag::UniformBuffers|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader); CORRADE_COMPARE(shader.materialCount(), 8); CORRADE_COMPARE(shader.drawCount(), 48); @@ -2267,7 +2267,7 @@ void MeshVisualizerGLTest::constructUniformBuffersAsync3D() { while(!state.isLinkFinished()) Utility::System::sleep(100); - MeshVisualizerGL3D shader{std::move(state)}; + MeshVisualizerGL3D shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader); CORRADE_COMPARE(state.materialCount(), 6); CORRADE_COMPARE(state.drawCount(), 24); @@ -2297,13 +2297,13 @@ void MeshVisualizerGLTest::constructMove2D() { MAGNUM_VERIFY_NO_GL_ERROR(); - MeshVisualizerGL2D b{std::move(a)}; + MeshVisualizerGL2D b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader); CORRADE_VERIFY(!a.id()); MeshVisualizerGL2D c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader); CORRADE_VERIFY(!b.id()); @@ -2320,13 +2320,13 @@ void MeshVisualizerGLTest::constructMove3D() { MAGNUM_VERIFY_NO_GL_ERROR(); - MeshVisualizerGL3D b{std::move(a)}; + MeshVisualizerGL3D b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader); CORRADE_VERIFY(!a.id()); MeshVisualizerGL3D c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader); CORRADE_VERIFY(!b.id()); @@ -2351,7 +2351,7 @@ void MeshVisualizerGLTest::constructMoveUniformBuffers2D() { MAGNUM_VERIFY_NO_GL_ERROR(); - MeshVisualizerGL2D b{std::move(a)}; + MeshVisualizerGL2D b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), MeshVisualizerGL2D::Flag::UniformBuffers|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader); CORRADE_COMPARE(b.materialCount(), 2); @@ -2362,7 +2362,7 @@ void MeshVisualizerGLTest::constructMoveUniformBuffers2D() { CORRADE_VERIFY(!a.id()); MeshVisualizerGL2D c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), MeshVisualizerGL2D::Flag::UniformBuffers|MeshVisualizerGL2D::Flag::Wireframe|MeshVisualizerGL2D::Flag::NoGeometryShader); CORRADE_COMPARE(c.materialCount(), 2); @@ -2391,7 +2391,7 @@ void MeshVisualizerGLTest::constructMoveUniformBuffers3D() { MAGNUM_VERIFY_NO_GL_ERROR(); - MeshVisualizerGL3D b{std::move(a)}; + MeshVisualizerGL3D b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader); CORRADE_COMPARE(b.materialCount(), 2); @@ -2402,7 +2402,7 @@ void MeshVisualizerGLTest::constructMoveUniformBuffers3D() { CORRADE_VERIFY(!a.id()); MeshVisualizerGL3D c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), MeshVisualizerGL3D::Flag::UniformBuffers|MeshVisualizerGL3D::Flag::Wireframe|MeshVisualizerGL3D::Flag::NoGeometryShader); CORRADE_COMPARE(c.materialCount(), 2); @@ -4305,7 +4305,7 @@ template void MeshVisualizerGLTest::renderWirefra GL::Buffer vertexId; vertexId.setData(vertexIndex); - circle.addVertexBuffer(std::move(vertexId), 0, MeshVisualizerGL2D::VertexIndex{}); + circle.addVertexBuffer(Utility::move(vertexId), 0, MeshVisualizerGL2D::VertexIndex{}); } } else circle = MeshTools::compile(circleData); @@ -4457,7 +4457,7 @@ template void MeshVisualizerGLTest::renderWirefra GL::Buffer vertexId; vertexId.setData(vertexIndex); - sphere.addVertexBuffer(std::move(vertexId), 0, MeshVisualizerGL3D::VertexIndex{}); + sphere.addVertexBuffer(Utility::move(vertexId), 0, MeshVisualizerGL3D::VertexIndex{}); } } else sphere = MeshTools::compile(sphereData); @@ -5697,7 +5697,7 @@ template void MeshVisualizerGLTest::renderInstanc GL::Buffer vertexId; vertexId.setData(vertexIndex); - circle.addVertexBuffer(std::move(vertexId), 0, MeshVisualizerGL2D::VertexIndex{}); + circle.addVertexBuffer(Utility::move(vertexId), 0, MeshVisualizerGL2D::VertexIndex{}); } } else circle = MeshTools::compile(circleData); @@ -5991,7 +5991,7 @@ template void MeshVisualizerGLTest::renderInstanc GL::Buffer vertexId; vertexId.setData(vertexIndex); - sphere.addVertexBuffer(std::move(vertexId), 0, MeshVisualizerGL3D::VertexIndex{}); + sphere.addVertexBuffer(Utility::move(vertexId), 0, MeshVisualizerGL3D::VertexIndex{}); } } else sphere = MeshTools::compile(sphereData); diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index a674d6b21..d7f86c2b0 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -1625,7 +1625,7 @@ void PhongGLTest::constructAsync() { while(!state.isLinkFinished()) Utility::System::sleep(100); - PhongGL shader{std::move(state)}; + PhongGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), PhongGL::Flag::SpecularTexture|PhongGL::Flag::InstancedTextureOffset); CORRADE_COMPARE(shader.lightCount(), 3); CORRADE_COMPARE(shader.perDrawLightCount(), 2); @@ -1733,7 +1733,7 @@ void PhongGLTest::constructUniformBuffersAsync() { while(!state.isLinkFinished()) Utility::System::sleep(100); - PhongGL shader{std::move(state)}; + PhongGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), PhongGL::Flag::UniformBuffers|PhongGL::Flag::LightCulling); CORRADE_COMPARE(shader.lightCount(), 2); CORRADE_COMPARE(shader.perDrawLightCount(), 1); @@ -1766,7 +1766,7 @@ void PhongGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); - PhongGL b{std::move(a)}; + PhongGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), PhongGL::Flag::AlphaMask); CORRADE_COMPARE(b.lightCount(), 3); @@ -1774,7 +1774,7 @@ void PhongGLTest::constructMove() { CORRADE_VERIFY(!a.id()); PhongGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), PhongGL::Flag::AlphaMask); CORRADE_COMPARE(c.lightCount(), 3); @@ -1802,7 +1802,7 @@ void PhongGLTest::constructMoveUniformBuffers() { MAGNUM_VERIFY_NO_GL_ERROR(); - PhongGL b{std::move(a)}; + PhongGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), PhongGL::Flag::UniformBuffers); CORRADE_COMPARE(b.lightCount(), 5); @@ -1815,7 +1815,7 @@ void PhongGLTest::constructMoveUniformBuffers() { CORRADE_VERIFY(!a.id()); PhongGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), PhongGL::Flag::UniformBuffers); CORRADE_COMPARE(c.lightCount(), 5); @@ -3114,7 +3114,7 @@ template void PhongGLTest::renderTexturedNormal() { tangents.setData(Containers::Array{DirectInit, 4, tangentBitangent}); plane.addVertexBuffer(tangents, 0, sizeof(TangentBitangent), GL::DynamicAttribute{Shaders::PhongGL::Tangent4{data.tangentComponents}}); - plane.addVertexBuffer(std::move(tangents), sizeof(Vector4), + plane.addVertexBuffer(Utility::move(tangents), sizeof(Vector4), sizeof(TangentBitangent), GL::DynamicAttribute{Shaders::PhongGL::Bitangent{}}); diff --git a/src/Magnum/Shaders/Test/ShadersGLBenchmark.cpp b/src/Magnum/Shaders/Test/ShadersGLBenchmark.cpp index 14b439ccb..d84985f10 100644 --- a/src/Magnum/Shaders/Test/ShadersGLBenchmark.cpp +++ b/src/Magnum/Shaders/Test/ShadersGLBenchmark.cpp @@ -429,7 +429,7 @@ ShadersGLBenchmark::ShadersGLBenchmark(): _framebuffer{{{}, RenderSize}} { Primitives::GridFlag::Tangents); Containers::Array vertexColors{DirectInit, data.vertexCount(), 0xffffffff_rgbaf}; Containers::Array bitangents{DirectInit, data.vertexCount(), Vector3{0.0f, 1.0f, 0.0f}}; - Trade::MeshData dataWithVertexColors = MeshTools::interleave(std::move(data), { + Trade::MeshData dataWithVertexColors = MeshTools::interleave(Utility::move(data), { Trade::MeshAttributeData{Trade::MeshAttribute::Color, arrayView(vertexColors)}, Trade::MeshAttributeData{Trade::MeshAttribute::Bitangent, arrayView(bitangents)} }); diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index 754558152..974102d62 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -430,7 +430,7 @@ template void VectorGLTest::constructAsync() { while(!state.isLinkFinished()) Utility::System::sleep(100); - VectorGL shader{std::move(state)}; + VectorGL shader{Utility::move(state)}; CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_COMPARE(shader.flags(), VectorGL2D::Flag::TextureTransformation); CORRADE_VERIFY(shader.id()); @@ -518,7 +518,7 @@ template void VectorGLTest::constructUniformBuffersAsync while(!state.isLinkFinished()) Utility::System::sleep(100); - VectorGL shader{std::move(state)}; + VectorGL shader{Utility::move(state)}; CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_COMPARE(shader.flags(), VectorGL2D::Flag::UniformBuffers|VectorGL2D::Flag::TextureTransformation); CORRADE_COMPARE(shader.materialCount(), 15); @@ -545,13 +545,13 @@ template void VectorGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); - VectorGL b{std::move(a)}; + VectorGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), VectorGL::Flag::TextureTransformation); CORRADE_VERIFY(!a.id()); VectorGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), VectorGL::Flag::TextureTransformation); CORRADE_VERIFY(!b.id()); @@ -575,7 +575,7 @@ template void VectorGLTest::constructMoveUniformBuffers( MAGNUM_VERIFY_NO_GL_ERROR(); - VectorGL b{std::move(a)}; + VectorGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), VectorGL::Flag::UniformBuffers); CORRADE_COMPARE(b.materialCount(), 2); @@ -583,7 +583,7 @@ template void VectorGLTest::constructMoveUniformBuffers( CORRADE_VERIFY(!a.id()); VectorGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), VectorGL::Flag::UniformBuffers); CORRADE_COMPARE(c.materialCount(), 2); diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index f34c94696..b5a9a2888 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -376,7 +376,7 @@ template void VertexColorGLTest::constructAsync() { while(!state.isLinkFinished()) Utility::System::sleep(100); - VertexColorGL shader{std::move(state)}; + VertexColorGL shader{Utility::move(state)}; CORRADE_VERIFY(shader.isLinkFinished()); CORRADE_VERIFY(shader.id()); { @@ -460,7 +460,7 @@ template void VertexColorGLTest::constructUniformBuffers while(!state.isLinkFinished()) Utility::System::sleep(100); - VertexColorGL shader{std::move(state)}; + VertexColorGL shader{Utility::move(state)}; CORRADE_COMPARE(shader.flags(), VertexColorGL2D::Flag::UniformBuffers); CORRADE_COMPARE(shader.drawCount(), 63); CORRADE_VERIFY(shader.isLinkFinished()); @@ -485,12 +485,12 @@ template void VertexColorGLTest::constructMove() { MAGNUM_VERIFY_NO_GL_ERROR(); - VertexColorGL b{std::move(a)}; + VertexColorGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_VERIFY(!a.id()); VertexColorGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_VERIFY(!b.id()); } @@ -512,14 +512,14 @@ template void VertexColorGLTest::constructMoveUniformBuf MAGNUM_VERIFY_NO_GL_ERROR(); - VertexColorGL b{std::move(a)}; + VertexColorGL b{Utility::move(a)}; CORRADE_COMPARE(b.id(), id); CORRADE_COMPARE(b.flags(), VertexColorGL::Flag::UniformBuffers); CORRADE_COMPARE(b.drawCount(), 5); CORRADE_VERIFY(!a.id()); VertexColorGL c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.flags(), VertexColorGL::Flag::UniformBuffers); CORRADE_COMPARE(c.drawCount(), 5); diff --git a/src/Magnum/Shaders/VectorGL.cpp b/src/Magnum/Shaders/VectorGL.cpp index 79d6c4f0b..256c73fe1 100644 --- a/src/Magnum/Shaders/VectorGL.cpp +++ b/src/Magnum/Shaders/VectorGL.cpp @@ -207,7 +207,7 @@ template typename VectorGL::CompileState Vec out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_GLES) || (!defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) , version #endif @@ -230,7 +230,7 @@ template typename VectorGL::CompileState Vec #endif #endif -template VectorGL::VectorGL(CompileState&& state): VectorGL{static_cast(std::move(state))} { +template VectorGL::VectorGL(CompileState&& state): VectorGL{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/VertexColorGL.cpp b/src/Magnum/Shaders/VertexColorGL.cpp index faee12bbc..dfff42fae 100644 --- a/src/Magnum/Shaders/VertexColorGL.cpp +++ b/src/Magnum/Shaders/VertexColorGL.cpp @@ -175,7 +175,7 @@ template typename VertexColorGL::CompileStat out.submitLink(); - return CompileState{std::move(out), std::move(vert), std::move(frag) + return CompileState{Utility::move(out), Utility::move(vert), Utility::move(frag) #if !defined(MAGNUM_TARGET_GLES) || (!defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) , version #endif @@ -197,7 +197,7 @@ template typename VertexColorGL::CompileStat #endif #endif -template VertexColorGL::VertexColorGL(CompileState&& state): VertexColorGL{static_cast(std::move(state))} { +template VertexColorGL::VertexColorGL(CompileState&& state): VertexColorGL{static_cast(Utility::move(state))} { #ifdef CORRADE_GRACEFUL_ASSERT /* When graceful assertions fire from within compile(), we get a NoCreate'd CompileState. Exiting makes it possible to test the assert. */ diff --git a/src/Magnum/Shaders/glShaderWrapper.cpp b/src/Magnum/Shaders/glShaderWrapper.cpp index aa1d416c7..855db1ede 100644 --- a/src/Magnum/Shaders/glShaderWrapper.cpp +++ b/src/Magnum/Shaders/glShaderWrapper.cpp @@ -36,7 +36,7 @@ GLShaderWrapper::GLShaderWrapper(GLShaderWrapper&& other) noexcept: type{other.t } GLShaderWrapper& GLShaderWrapper::operator=(GLShaderWrapper&& other) noexcept { - using std::swap; + using Utility::swap; swap(other.type, type); swap(other.id, id); return *this; @@ -45,7 +45,7 @@ GLShaderWrapper& GLShaderWrapper::operator=(GLShaderWrapper&& other) noexcept { GLShaderWrapper::~GLShaderWrapper() { /* Convert itself to a temporary GL::Shader, triggering deletion in its destructor. Cast to void to avoid warnings about an unused result. */ - if(id) static_cast(GL::Shader{std::move(*this)}); + if(id) static_cast(GL::Shader{Utility::move(*this)}); } GLShaderWrapper::operator GL::Shader() & noexcept { diff --git a/src/Magnum/Test/ImageTest.cpp b/src/Magnum/Test/ImageTest.cpp index d7792e21a..a1ac041a1 100644 --- a/src/Magnum/Test/ImageTest.cpp +++ b/src/Magnum/Test/ImageTest.cpp @@ -521,7 +521,7 @@ void ImageTest::constructMoveGeneric() { auto data = new char[3*16]; Image2D a{PixelStorage{}.setAlignment(1), PixelFormat::RGBA32F, {1, 3}, Containers::Array{data, 3*16}, ImageFlag2D::Array}; - Image2D b(std::move(a)); + Image2D b(Utility::move(a)); CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -537,7 +537,7 @@ void ImageTest::constructMoveGeneric() { auto data2 = new char[24]; Image2D c{PixelFormat::R8I, {2, 6}, Containers::Array{data2, 24}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), (Vector2i{2, 6})); @@ -559,7 +559,7 @@ void ImageTest::constructMoveImplementationSpecific() { auto data = new char[3*6]; Image2D a{PixelStorage{}.setAlignment(1), GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array{data, 3*6}, ImageFlag2D::Array}; - Image2D b(std::move(a)); + Image2D b(Utility::move(a)); CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -576,7 +576,7 @@ void ImageTest::constructMoveImplementationSpecific() { auto data2 = new char[12*4*2]; Image2D c{PixelStorage{}, 1, 2, 8, {2, 6}, Containers::Array{data2, 12*4*2}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), Vector2i(2, 6)); @@ -596,7 +596,7 @@ void ImageTest::constructMoveCompressedGeneric() { CompressedImage2D a{ CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), CompressedPixelFormat::Bc3RGBAUnorm, {4, 4}, Containers::Array{data, 8}, ImageFlag2D::Array}; - CompressedImage2D b{std::move(a)}; + CompressedImage2D b{Utility::move(a)}; CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -610,7 +610,7 @@ void ImageTest::constructMoveCompressedGeneric() { auto data2 = new char[16]; CompressedImage2D c{CompressedPixelFormat::Bc1RGBAUnorm, {8, 4}, Containers::Array{data2, 16}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), (Vector2i{8, 4})); @@ -631,7 +631,7 @@ void ImageTest::constructMoveCompressedImplementationSpecific() { CompressedImage2D a{ CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array{data, 8}, ImageFlag2D::Array}; - CompressedImage2D b{std::move(a)}; + CompressedImage2D b{Utility::move(a)}; CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -645,7 +645,7 @@ void ImageTest::constructMoveCompressedImplementationSpecific() { auto data2 = new char[16]; CompressedImage2D c{CompressedPixelFormat::Bc2RGBAUnorm, {8, 4}, Containers::Array{data2, 16}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), (Vector2i{8, 4})); diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index 5819a43f5..f6a924d0e 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -120,7 +120,7 @@ std::vector>> AbstractFontConvert std::vector>> out; Containers::Array result = doExportFontToSingleData(font, cache, characters); - if(result) out.emplace_back(filename, std::move(result)); + if(result) out.emplace_back(filename, Utility::move(result)); return out; } @@ -183,7 +183,7 @@ std::vector>> AbstractFontConvert std::vector>> out; Containers::Array result = doExportGlyphCacheToSingleData(cache); - if(result) out.emplace_back(filename, std::move(result)); + if(result) out.emplace_back(filename, Utility::move(result)); return out; } diff --git a/src/Magnum/Text/Renderer.cpp b/src/Magnum/Text/Renderer.cpp index 5eb01d3af..bf22b3324 100644 --- a/src/Magnum/Text/Renderer.cpp +++ b/src/Magnum/Text/Renderer.cpp @@ -173,7 +173,7 @@ std::tuple, Range2D> renderVerticesInternal(AbstractFont& fo rectangle = rectangle.translated(Vector2::yAxis(alignmentOffsetY)); for(auto& v: vertices) v.position.y() += alignmentOffsetY; - return std::make_tuple(std::move(vertices), rectangle); + return std::make_tuple(Utility::move(vertices), rectangle); } std::pair, MeshIndexType> renderIndicesInternal(const UnsignedInt glyphCount) { @@ -196,7 +196,7 @@ std::pair, MeshIndexType> renderIndicesInternal(const Un createIndices(indices, glyphCount); } - return {std::move(indices), indexType}; + return {Utility::move(indices), indexType}; } std::tuple renderInternal(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, GL::Buffer& vertexBuffer, GL::Buffer& indexBuffer, GL::BufferUsage usage, Alignment alignment) { @@ -222,7 +222,7 @@ std::tuple renderInternal(AbstractFont& font, const GlyphCach .setCount(indexCount) .setIndexBuffer(indexBuffer, 0, indexType, 0, vertices.size()); - return std::make_tuple(std::move(mesh), rectangle); + return std::make_tuple(Utility::move(mesh), rectangle); } } @@ -247,7 +247,7 @@ std::tuple, std::vector, std::vector, std::vector indices(glyphCount*6); createIndices(indices.data(), glyphCount); - return std::make_tuple(std::move(positions), std::move(textureCoordinates), std::move(indices), rectangle); + return std::make_tuple(Utility::move(positions), Utility::move(textureCoordinates), Utility::move(indices), rectangle); } template std::tuple Renderer::render(AbstractFont& font, const GlyphCache& cache, Float size, const std::string& text, GL::Buffer& vertexBuffer, GL::Buffer& indexBuffer, GL::BufferUsage usage, Alignment alignment) { diff --git a/src/Magnum/TextureTools/Atlas.cpp b/src/Magnum/TextureTools/Atlas.cpp index d3c51115a..f6d1088fc 100644 --- a/src/Magnum/TextureTools/Atlas.cpp +++ b/src/Magnum/TextureTools/Atlas.cpp @@ -137,7 +137,7 @@ Containers::Pair> atlasArrayPowerOfTwo(const Ve --free; } - return {layer + 1, std::move(output)}; + return {layer + 1, Utility::move(output)}; } Containers::Pair> atlasArrayPowerOfTwo(const Vector2i& layerSize, const std::initializer_list sizes) { diff --git a/src/Magnum/TextureTools/DistanceField.cpp b/src/Magnum/TextureTools/DistanceField.cpp index bfc540ef0..8dc82b6a6 100644 --- a/src/Magnum/TextureTools/DistanceField.cpp +++ b/src/Magnum/TextureTools/DistanceField.cpp @@ -182,7 +182,7 @@ DistanceField::DistanceField(const UnsignedInt radius): _state{new State{radius} }; GL::Buffer buffer; buffer.setData(triangle, GL::BufferUsage::StaticDraw); - _state->mesh.addVertexBuffer(std::move(buffer), 0, DistanceFieldShader::Position()); + _state->mesh.addVertexBuffer(Utility::move(buffer), 0, DistanceFieldShader::Position()); } } diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 9ad3ab155..d128d5142 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -336,7 +336,7 @@ AbstractImageConverter::convertToData(const ImageView1D& image) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::ImageConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -369,7 +369,7 @@ AbstractImageConverter::convertToData(const ImageView2D& image) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::ImageConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -385,7 +385,7 @@ Containers::Optional> AbstractImageConverter::doConvertT #ifdef MAGNUM_BUILD_DEPRECATED Containers::Array AbstractImageConverter::exportToData(const ImageView2D& image) { Containers::Optional> out = convertToData(image); - return out ? *std::move(out) : nullptr; + return out ? *Utility::move(out) : nullptr; } #endif @@ -409,7 +409,7 @@ AbstractImageConverter::convertToData(const ImageView3D& image) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::ImageConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -442,7 +442,7 @@ AbstractImageConverter::convertToData(const CompressedImageView1D& image) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::ImageConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -475,7 +475,7 @@ AbstractImageConverter::convertToData(const CompressedImageView2D& image) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::ImageConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -491,7 +491,7 @@ Containers::Optional> AbstractImageConverter::doConvertT #ifdef MAGNUM_BUILD_DEPRECATED Containers::Array AbstractImageConverter::exportToData(const CompressedImageView2D& image) { Containers::Optional> out = convertToData(image); - return out ? *std::move(out) : nullptr; + return out ? *Utility::move(out) : nullptr; } #endif @@ -515,7 +515,7 @@ AbstractImageConverter::convertToData(const CompressedImageView3D& image) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::ImageConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -549,7 +549,7 @@ AbstractImageConverter::convertToData(const ImageData2D& image) { #ifdef MAGNUM_BUILD_DEPRECATED Containers::Array AbstractImageConverter::exportToData(const ImageData2D& image) { Containers::Optional> out = convertToData(image); - return out ? *std::move(out) : nullptr; + return out ? *Utility::move(out) : nullptr; } #endif @@ -647,7 +647,7 @@ AbstractImageConverter::convertToData(const Containers::ArrayView{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -686,7 +686,7 @@ AbstractImageConverter::convertToData(const Containers::ArrayView{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -725,7 +725,7 @@ AbstractImageConverter::convertToData(const Containers::ArrayView{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -764,7 +764,7 @@ AbstractImageConverter::convertToData(const Containers::ArrayView{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -803,7 +803,7 @@ AbstractImageConverter::convertToData(const Containers::ArrayView{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -842,7 +842,7 @@ AbstractImageConverter::convertToData(const Containers::ArrayView{std::move(out)}; + return Implementation::ImageConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 378ea4984..4727c7943 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -444,9 +444,9 @@ namespace Implementation { functionality seems silly. */ template struct ImageConverterOptionalButAlsoArray: Containers::Optional> { /*implicit*/ ImageConverterOptionalButAlsoArray() = default; - /*implicit*/ ImageConverterOptionalButAlsoArray(Containers::Optional>&& optional): Containers::Optional>{std::move(optional)} {} + /*implicit*/ ImageConverterOptionalButAlsoArray(Containers::Optional>&& optional): Containers::Optional>{Utility::move(optional)} {} CORRADE_DEPRECATED("use Containers::Optional> instead") /*implicit*/ operator Containers::Array() && { - return *this ? Containers::Array{std::move(**this)} : nullptr; + return *this ? Containers::Array{Utility::move(**this)} : nullptr; } }; } diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 0cd0238e2..143c18777 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -269,7 +269,7 @@ void AbstractImporter::doOpenFile(const Containers::StringView filename) { return; } - doOpenData(*std::move(data), DataFlag::Owned|DataFlag::Mutable); + doOpenData(*Utility::move(data), DataFlag::Owned|DataFlag::Mutable); } } @@ -753,12 +753,12 @@ Containers::Pointer AbstractImporter::doObject2D(const UnsignedInt if(!mesh.isEmpty()) { return Containers::pointer(flags & ObjectFlag2D::HasTranslationRotationScaling ? - new MeshObjectData2D{std::move(children), + new MeshObjectData2D{Utility::move(children), trs->first(), trs->second(), trs->third(), mesh.front().first(), mesh.front().second(), skin.isEmpty() ? -1 : Int(skin.front()), importerState ? *importerState : nullptr} : - new MeshObjectData2D{std::move(children), + new MeshObjectData2D{Utility::move(children), *transformation, mesh.front().first(), mesh.front().second(), skin ? Int(*skin) : -1, @@ -776,11 +776,11 @@ Containers::Pointer AbstractImporter::doObject2D(const UnsignedInt } return Containers::pointer(flags & ObjectFlag2D::HasTranslationRotationScaling ? - new ObjectData2D{std::move(children), + new ObjectData2D{Utility::move(children), trs->first(), trs->second(), trs->third(), instanceType, instance, importerState ? *importerState : nullptr} : - new ObjectData2D{std::move(children), + new ObjectData2D{Utility::move(children), *transformation, instanceType, instance, importerState ? *importerState : nullptr}); @@ -932,12 +932,12 @@ Containers::Pointer AbstractImporter::doObject3D(const UnsignedInt if(!mesh.isEmpty()) { return Containers::pointer(flags & ObjectFlag3D::HasTranslationRotationScaling ? - new MeshObjectData3D{std::move(children), + new MeshObjectData3D{Utility::move(children), trs->first(), trs->second(), trs->third(), mesh.front().first(), mesh.front().second(), skin.isEmpty() ? -1 : Int(skin.front()), importerState ? *importerState : nullptr} : - new MeshObjectData3D{std::move(children), + new MeshObjectData3D{Utility::move(children), *transformation, mesh.front().first(), mesh.front().second(), skin ? Int(*skin) : -1, @@ -958,11 +958,11 @@ Containers::Pointer AbstractImporter::doObject3D(const UnsignedInt } return Containers::pointer(flags & ObjectFlag3D::HasTranslationRotationScaling ? - new ObjectData3D{std::move(children), + new ObjectData3D{Utility::move(children), trs->first(), trs->second(), trs->third(), instanceType, instance, importerState ? *importerState : nullptr} : - new ObjectData3D{std::move(children), + new ObjectData3D{Utility::move(children), *transformation, instanceType, instance, importerState ? *importerState : nullptr}); @@ -1318,7 +1318,7 @@ AbstractImporter::material(const UnsignedInt id) { /* GCC 4.8 and clang-cl needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::OptionalButAlsoPointer{std::move(material)}; + return Implementation::OptionalButAlsoPointer{Utility::move(material)}; #else return material; #endif diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index 68026c58d..863bddfcf 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -160,9 +160,9 @@ namespace Implementation { mean I'd need to include MaterialData here */ template struct OptionalButAlsoPointer: Containers::Optional { /*implicit*/ OptionalButAlsoPointer() = default; - /*implicit*/ OptionalButAlsoPointer(Containers::Optional&& optional): Containers::Optional{std::move(optional)} {} + /*implicit*/ OptionalButAlsoPointer(Containers::Optional&& optional): Containers::Optional{Utility::move(optional)} {} CORRADE_DEPRECATED("use Containers::Optional instead of Containers::Pointer for a MaterialData") /*implicit*/ operator Containers::Pointer() && { - return Containers::Pointer{new T{std::move(**this)}}; + return Containers::Pointer{new T{Utility::move(**this)}}; } }; } diff --git a/src/Magnum/Trade/AbstractSceneConverter.cpp b/src/Magnum/Trade/AbstractSceneConverter.cpp index 1b1674d46..617504a5d 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.cpp +++ b/src/Magnum/Trade/AbstractSceneConverter.cpp @@ -309,7 +309,7 @@ AbstractSceneConverter::convertToData(const MeshData& mesh) { /* GCC 4.8 needs an explicit conversion here */ #ifdef MAGNUM_BUILD_DEPRECATED - return Implementation::SceneConverterOptionalButAlsoArray{std::move(out)}; + return Implementation::SceneConverterOptionalButAlsoArray{Utility::move(out)}; #else return out; #endif @@ -423,7 +423,7 @@ Containers::Pointer AbstractSceneConverter::end() { } struct SingleMeshImporter: AbstractImporter { - explicit SingleMeshImporter(Containers::Optional&& mesh) noexcept: _mesh{std::move(mesh)} {} + explicit SingleMeshImporter(Containers::Optional&& mesh) noexcept: _mesh{Utility::move(mesh)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return _opened; } @@ -445,7 +445,7 @@ Containers::Pointer AbstractSceneConverter::end() { return {}; } - Containers::Optional out = std::move(_mesh); + Containers::Optional out = Utility::move(_mesh); _mesh = {}; return out; } @@ -455,7 +455,7 @@ Containers::Pointer AbstractSceneConverter::end() { Containers::Optional _mesh; }; - return Containers::Pointer(new SingleMeshImporter{std::move(_state->converted.mesh)}); + return Containers::Pointer(new SingleMeshImporter{Utility::move(_state->converted.mesh)}); } else if(features() & SceneConverterFeature::ConvertMultiple) { return doEnd(); @@ -515,7 +515,7 @@ Containers::Optional> AbstractSceneConverter::endData() /* No deleter validity checks here, those were performed in convertToData(const MeshData&) already */ - return std::move(_state->converted.meshToData); + return Utility::move(_state->converted.meshToData); } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } @@ -1348,7 +1348,7 @@ bool AbstractSceneConverter::addImporterContentsInternal(AbstractImporter& impor } } - arrayAppend(levels, *std::move(mesh)); + arrayAppend(levels, *Utility::move(mesh)); } const Containers::String name = contents & SceneContent::Names ? importer.meshName(i) : Containers::String{}; @@ -1401,7 +1401,7 @@ bool AbstractSceneConverter::addImporterContentsInternal(AbstractImporter& impor return false; } - arrayAppend(levels, *std::move(image)); + arrayAppend(levels, *Utility::move(image)); } const Containers::String name = contents & SceneContent::Names ? importer.image1DName(i) : Containers::String{}; @@ -1454,7 +1454,7 @@ bool AbstractSceneConverter::addImporterContentsInternal(AbstractImporter& impor return false; } - arrayAppend(levels, *std::move(image)); + arrayAppend(levels, *Utility::move(image)); } const Containers::String name = contents & SceneContent::Names ? importer.image2DName(i) : Containers::String{}; @@ -1507,7 +1507,7 @@ bool AbstractSceneConverter::addImporterContentsInternal(AbstractImporter& impor return false; } - arrayAppend(levels, *std::move(image)); + arrayAppend(levels, *Utility::move(image)); } const Containers::String name = contents & SceneContent::Names ? importer.image3DName(i) : Containers::String{}; diff --git a/src/Magnum/Trade/AbstractSceneConverter.h b/src/Magnum/Trade/AbstractSceneConverter.h index 8ce895295..2b100c93c 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.h +++ b/src/Magnum/Trade/AbstractSceneConverter.h @@ -549,9 +549,9 @@ namespace Implementation { functionality seems silly. */ template struct SceneConverterOptionalButAlsoArray: Containers::Optional> { /*implicit*/ SceneConverterOptionalButAlsoArray() = default; - /*implicit*/ SceneConverterOptionalButAlsoArray(Containers::Optional>&& optional): Containers::Optional>{std::move(optional)} {} + /*implicit*/ SceneConverterOptionalButAlsoArray(Containers::Optional>&& optional): Containers::Optional>{Utility::move(optional)} {} CORRADE_DEPRECATED("use Containers::Optional> instead") /*implicit*/ operator Containers::Array() && { - return *this ? Containers::Array{std::move(**this)} : nullptr; + return *this ? Containers::Array{Utility::move(**this)} : nullptr; } }; } diff --git a/src/Magnum/Trade/AnimationData.cpp b/src/Magnum/Trade/AnimationData.cpp index a7aafa113..53257815c 100644 --- a/src/Magnum/Trade/AnimationData.cpp +++ b/src/Magnum/Trade/AnimationData.cpp @@ -272,11 +272,11 @@ Animation::TrackViewStorage AnimationTrackData::track() const { _interpolation, _interpolator, _before, _after}; } -AnimationData::AnimationData(Containers::Array&& data, Containers::Array&& tracks, const Range1D& duration, const void* importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _duration{duration}, _data{std::move(data)}, _tracks{std::move(tracks)}, _importerState{importerState} {} +AnimationData::AnimationData(Containers::Array&& data, Containers::Array&& tracks, const Range1D& duration, const void* importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _duration{duration}, _data{Utility::move(data)}, _tracks{Utility::move(tracks)}, _importerState{importerState} {} -AnimationData::AnimationData(Containers::Array&& data, std::initializer_list tracks, const Range1D& duration, const void* importerState): AnimationData{std::move(data), Implementation::initializerListToArrayWithDefaultDeleter(tracks), duration, importerState} {} +AnimationData::AnimationData(Containers::Array&& data, std::initializer_list tracks, const Range1D& duration, const void* importerState): AnimationData{Utility::move(data), Implementation::initializerListToArrayWithDefaultDeleter(tracks), duration, importerState} {} -AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayView data, Containers::Array&& tracks, const Range1D& duration, const void* importerState) noexcept: AnimationData{Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, std::move(tracks), duration, importerState} { +AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayView data, Containers::Array&& tracks, const Range1D& duration, const void* importerState) noexcept: AnimationData{Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, Utility::move(tracks), duration, importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), "Trade::AnimationData: can't construct a non-owned instance with" << dataFlags, ); _dataFlags = dataFlags; @@ -284,7 +284,7 @@ AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayV AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayView data, std::initializer_list tracks, const Range1D& duration, const void* importerState): AnimationData{dataFlags, data, Implementation::initializerListToArrayWithDefaultDeleter(tracks), duration, importerState} {} -AnimationData::AnimationData(Containers::Array&& data, Containers::Array&& tracks, const void* importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _data{std::move(data)}, _tracks{std::move(tracks)}, _importerState{importerState} { +AnimationData::AnimationData(Containers::Array&& data, Containers::Array&& tracks, const void* importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _data{Utility::move(data)}, _tracks{Utility::move(tracks)}, _importerState{importerState} { if(!_tracks.isEmpty()) { const auto duration = [](const AnimationTrackData& track) { if(!track._size) return Range1D{}; @@ -302,9 +302,9 @@ AnimationData::AnimationData(Containers::Array&& data, Containers::Array&& data, std::initializer_list tracks, const void* importerState): AnimationData{std::move(data), Implementation::initializerListToArrayWithDefaultDeleter(tracks), importerState} {} +AnimationData::AnimationData(Containers::Array&& data, std::initializer_list tracks, const void* importerState): AnimationData{Utility::move(data), Implementation::initializerListToArrayWithDefaultDeleter(tracks), importerState} {} -AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayView data, Containers::Array&& tracks, const void* importerState) noexcept: AnimationData{Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, std::move(tracks), importerState} { +AnimationData::AnimationData(const DataFlags dataFlags, const Containers::ArrayView data, Containers::Array&& tracks, const void* importerState) noexcept: AnimationData{Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, Utility::move(tracks), importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), "Trade::AnimationData: can't construct a non-owned instance with" << dataFlags, ); _dataFlags = dataFlags; @@ -367,7 +367,7 @@ Animation::TrackViewStorage AnimationData::mutableTrack(UnsignedInt id) { Containers::Array AnimationData::release() { _tracks = nullptr; - return std::move(_data); + return Utility::move(_data); } template auto animationInterpolatorFor(Animation::Interpolation interpolation) -> R(*)(const V&, const V&, Float) { diff --git a/src/Magnum/Trade/ImageData.cpp b/src/Magnum/Trade/ImageData.cpp index 0f1429195..2a43d3ed3 100644 --- a/src/Magnum/Trade/ImageData.cpp +++ b/src/Magnum/Trade/ImageData.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Trade { -template ImageData::ImageData(const PixelStorage storage, const PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, format, {}, pixelFormatSize(format), size, std::move(data), flags, importerState} {} +template ImageData::ImageData(const PixelStorage storage, const PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, format, {}, pixelFormatSize(format), size, Utility::move(data), flags, importerState} {} template ImageData::ImageData(const PixelStorage storage, const PixelFormat format, const VectorTypeFor& size, const DataFlags dataFlags, const Containers::ArrayView data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, format, size, Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, flags, importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), @@ -41,7 +41,7 @@ template ImageData::ImageData(const PixelSto _dataFlags = dataFlags; } -template ImageData::ImageData(const PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{{}, format, size, std::move(data), flags, importerState} {} +template ImageData::ImageData(const PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{{}, format, size, Utility::move(data), flags, importerState} {} template ImageData::ImageData(const PixelFormat format, const VectorTypeFor& size, const DataFlags dataFlags, const Containers::ArrayView data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{format, size, Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, flags, importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), @@ -49,9 +49,9 @@ template ImageData::ImageData(const PixelFor _dataFlags = dataFlags; } -template ImageData::ImageData(const PixelStorage storage, const UnsignedInt format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, pixelFormatWrap(format), formatExtra, pixelSize, size, std::move(data), flags, importerState} {} +template ImageData::ImageData(const PixelStorage storage, const UnsignedInt format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, pixelFormatWrap(format), formatExtra, pixelSize, size, Utility::move(data), flags, importerState} {} -template ImageData::ImageData(const PixelStorage storage, const PixelFormat format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _compressed{false}, _flags{flags}, _storage{storage}, _format{format}, _formatExtra{formatExtra}, _pixelSize{pixelSize}, _size{size}, _data{std::move(data)}, _importerState{importerState} { +template ImageData::ImageData(const PixelStorage storage, const PixelFormat format, const UnsignedInt formatExtra, const UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _compressed{false}, _flags{flags}, _storage{storage}, _format{format}, _formatExtra{formatExtra}, _pixelSize{pixelSize}, _size{size}, _data{Utility::move(data)}, _importerState{importerState} { CORRADE_ASSERT(Magnum::Implementation::imageDataSize(*this) <= _data.size(), "Trade::ImageData: data too small, got" << _data.size() << "but expected at least" << Magnum::Implementation::imageDataSize(*this) << "bytes", ); #ifndef CORRADE_NO_ASSERT Magnum::Implementation::checkImageFlagsForSize("Trade::ImageData:", flags, size); @@ -66,7 +66,7 @@ template ImageData::ImageData(const PixelSto _dataFlags = dataFlags; } -template ImageData::ImageData(const CompressedPixelStorage storage, const CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _compressed{true}, _flags{flags}, _compressedStorage{storage}, _compressedFormat{format}, _size{size}, _data{std::move(data)}, _importerState{importerState} { +template ImageData::ImageData(const CompressedPixelStorage storage, const CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _compressed{true}, _flags{flags}, _compressedStorage{storage}, _compressedFormat{format}, _size{size}, _data{Utility::move(data)}, _importerState{importerState} { #ifndef CORRADE_NO_ASSERT Magnum::Implementation::checkImageFlagsForSize("Trade::ImageData:", flags, size); #endif @@ -78,7 +78,7 @@ template ImageData::ImageData(const Compress _dataFlags = dataFlags; } -template ImageData::ImageData(const CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{{}, format, size, std::move(data), flags, importerState} {} +template ImageData::ImageData(const CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{{}, format, size, Utility::move(data), flags, importerState} {} template ImageData::ImageData(const CompressedPixelFormat format, const VectorTypeFor& size, const DataFlags dataFlags, const Containers::ArrayView data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{format, size, Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, flags, importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), @@ -86,7 +86,7 @@ template ImageData::ImageData(const Compress _dataFlags = dataFlags; } -template ImageData::ImageData(const CompressedPixelStorage storage, const UnsignedInt format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, compressedPixelFormatWrap(format), size, std::move(data), flags, importerState} {} +template ImageData::ImageData(const CompressedPixelStorage storage, const UnsignedInt format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, compressedPixelFormatWrap(format), size, Utility::move(data), flags, importerState} {} template ImageData::ImageData(const CompressedPixelStorage storage, const UnsignedInt format, const VectorTypeFor& size, const DataFlags dataFlags, const Containers::ArrayView data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, format, size, Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, flags, importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), @@ -94,27 +94,27 @@ template ImageData::ImageData(const Compress _dataFlags = dataFlags; } -template ImageData::ImageData(ImageData&& other) noexcept: _dataFlags{other._dataFlags}, _compressed{std::move(other._compressed)}, _flags{std::move(other._flags)}, _size{std::move(other._size)}, _data{std::move(other._data)}, _importerState{std::move(other._importerState)} { +template ImageData::ImageData(ImageData&& other) noexcept: _dataFlags{other._dataFlags}, _compressed{Utility::move(other._compressed)}, _flags{Utility::move(other._flags)}, _size{Utility::move(other._size)}, _data{Utility::move(other._data)}, _importerState{Utility::move(other._importerState)} { if(_compressed) { - new(&_compressedStorage) CompressedPixelStorage{std::move(other._compressedStorage)}; - _compressedFormat = std::move(other._compressedFormat); + new(&_compressedStorage) CompressedPixelStorage{Utility::move(other._compressedStorage)}; + _compressedFormat = Utility::move(other._compressedFormat); } else { - new(&_storage) PixelStorage{std::move(other._storage)}; - _format = std::move(other._format); - _formatExtra = std::move(other._formatExtra); - _pixelSize = std::move(other._pixelSize); + new(&_storage) PixelStorage{Utility::move(other._storage)}; + _format = Utility::move(other._format); + _formatExtra = Utility::move(other._formatExtra); + _pixelSize = Utility::move(other._pixelSize); } other._size = {}; } -template ImageData::ImageData(ImageData&& other, const void* const importerState) noexcept: ImageData{std::move(other)} { +template ImageData::ImageData(ImageData&& other, const void* const importerState) noexcept: ImageData{Utility::move(other)} { _importerState = importerState; } template ImageData& ImageData::operator=(ImageData&& other) noexcept { - using std::swap; + using Utility::swap; swap(_dataFlags, other._dataFlags); swap(_compressed, other._compressed); swap(_flags, other._flags); @@ -217,7 +217,7 @@ template ImageData::operator BasicMutableCom } template Containers::Array ImageData::release() { - Containers::Array data{std::move(_data)}; + Containers::Array data{Utility::move(_data)}; _size = {}; return data; } diff --git a/src/Magnum/Trade/ImageData.h b/src/Magnum/Trade/ImageData.h index 621001042..629dc80c3 100644 --- a/src/Magnum/Trade/ImageData.h +++ b/src/Magnum/Trade/ImageData.h @@ -172,7 +172,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(PixelStorage, PixelFormat, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, std::move(data), {}, importerState} {} + explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, Utility::move(data), {}, importerState} {} #endif /** @@ -223,7 +223,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(PixelFormat, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{format, size, std::move(data), {}, importerState} {} + explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{format, size, Utility::move(data), {}, importerState} {} #endif /** @@ -296,14 +296,14 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(PixelStorage, UnsignedInt, UnsignedInt, UnsignedInt, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, UnsignedInt format, UnsignedInt formatExtra, UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, formatExtra, pixelSize, size, std::move(data), {}, importerState} {} + explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, UnsignedInt format, UnsignedInt formatExtra, UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, formatExtra, pixelSize, size, Utility::move(data), {}, importerState} {} /** * @overload * @m_deprecated_since_latest Use @ref ImageData(PixelStorage, PixelFormat, UnsignedInt, UnsignedInt, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, PixelFormat format, UnsignedInt formatExtra, UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, formatExtra, pixelSize, size, std::move(data), {}, importerState} {} + explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, PixelFormat format, UnsignedInt formatExtra, UnsignedInt pixelSize, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, formatExtra, pixelSize, size, Utility::move(data), {}, importerState} {} #endif /** @@ -374,7 +374,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(PixelStorage, T, U, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - template explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, T format, U formatExtra, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, formatExtra, size, std::move(data), {}, importerState} {} + template explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, T format, U formatExtra, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, formatExtra, size, Utility::move(data), {}, importerState} {} #endif /** @@ -428,7 +428,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(PixelStorage, T, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - template explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, T format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, std::move(data), {}, importerState} {} + template explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(PixelStorage storage, T format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, Utility::move(data), {}, importerState} {} #endif /** @@ -477,7 +477,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(CompressedPixelStorage, CompressedPixelFormat, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(CompressedPixelStorage storage, CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, std::move(data), {}, importerState} {} + explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(CompressedPixelStorage storage, CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, Utility::move(data), {}, importerState} {} #endif /** @@ -528,7 +528,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(CompressedPixelFormat, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{format, size, std::move(data), {}, importerState} {} + explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(CompressedPixelFormat format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{format, size, Utility::move(data), {}, importerState} {} #endif /** @@ -582,7 +582,7 @@ template class ImageData { * @m_deprecated_since_latest Use @ref ImageData(CompressedPixelStorage, T, const VectorTypeFor&, Containers::Array&&, ImageFlags, const void*) * instead. */ - template explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(CompressedPixelStorage storage, T format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, std::move(data), {}, importerState} {} + template explicit CORRADE_DEPRECATED("use a constructor with an extra ImageFlags argument instead") ImageData(CompressedPixelStorage storage, T format, const VectorTypeFor& size, Containers::Array&& data, const void* importerState) noexcept: ImageData{storage, format, size, Utility::move(data), {}, importerState} {} #endif /** @@ -941,7 +941,7 @@ typedef ImageData<2> ImageData2D; /** @brief Three-dimensional image data */ typedef ImageData<3> ImageData3D; -template template ImageData::ImageData(const PixelStorage storage, const T format, const U formatExtra, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, UnsignedInt(format), UnsignedInt(formatExtra), Magnum::Implementation::pixelFormatSizeAdl(format, formatExtra), size, std::move(data), flags, importerState} { +template template ImageData::ImageData(const PixelStorage storage, const T format, const U formatExtra, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, UnsignedInt(format), UnsignedInt(formatExtra), Magnum::Implementation::pixelFormatSizeAdl(format, formatExtra), size, Utility::move(data), flags, importerState} { static_assert(sizeof(T) <= 4 && sizeof(U) <= 4, "format types larger than 32bits are not supported"); } @@ -951,7 +951,7 @@ template template ImageData template ImageData::ImageData(const PixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, UnsignedInt(format), {}, Magnum::Implementation::pixelFormatSizeAdl(format), size, std::move(data), flags, importerState} { +template template ImageData::ImageData(const PixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, UnsignedInt(format), {}, Magnum::Implementation::pixelFormatSizeAdl(format), size, Utility::move(data), flags, importerState} { static_assert(sizeof(T) <= 4, "format types larger than 32bits are not supported"); } @@ -961,7 +961,7 @@ template template ImageData::ImageD "format types larger than 32bits are not supported"); } -template template ImageData::ImageData(const CompressedPixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, UnsignedInt(format), size, std::move(data), flags, importerState} { +template template ImageData::ImageData(const CompressedPixelStorage storage, const T format, const VectorTypeFor& size, Containers::Array&& data, const ImageFlags flags, const void* const importerState) noexcept: ImageData{storage, UnsignedInt(format), size, Utility::move(data), flags, importerState} { static_assert(sizeof(T) <= 4, "format types larger than 32bits are not supported"); } diff --git a/src/Magnum/Trade/MaterialData.cpp b/src/Magnum/Trade/MaterialData.cpp index 9dc2ead9f..d4212ff4b 100644 --- a/src/Magnum/Trade/MaterialData.cpp +++ b/src/Magnum/Trade/MaterialData.cpp @@ -275,7 +275,7 @@ template<> MAGNUM_TRADE_EXPORT Containers::ArrayView MaterialAttribu } #endif -MaterialData::MaterialData(const MaterialTypes types, Containers::Array&& attributeData, Containers::Array&& layerData, const void* const importerState) noexcept: _data{std::move(attributeData)}, _layerOffsets{std::move(layerData)}, _types{types}, _attributeDataFlags{DataFlag::Owned|DataFlag::Mutable}, _layerDataFlags{DataFlag::Owned|DataFlag::Mutable}, _importerState{importerState} { +MaterialData::MaterialData(const MaterialTypes types, Containers::Array&& attributeData, Containers::Array&& layerData, const void* const importerState) noexcept: _data{Utility::move(attributeData)}, _layerOffsets{Utility::move(layerData)}, _types{types}, _attributeDataFlags{DataFlag::Owned|DataFlag::Mutable}, _layerDataFlags{DataFlag::Owned|DataFlag::Mutable}, _importerState{importerState} { #ifndef CORRADE_NO_ASSERT /* Not checking what's already done in MaterialAttributeData constructor. Done before sorting so the index refers to the actual input index. */ @@ -1140,11 +1140,11 @@ Float MaterialData::alphaMask() const { } Containers::Array MaterialData::releaseLayerData() { - return std::move(_layerOffsets); + return Utility::move(_layerOffsets); } Containers::Array MaterialData::releaseAttributeData() { - return std::move(_data); + return Utility::move(_data); } Debug& operator<<(Debug& debug, const MaterialLayer value) { diff --git a/src/Magnum/Trade/MaterialData.h b/src/Magnum/Trade/MaterialData.h index 8d803aa53..e34bd4dc2 100644 --- a/src/Magnum/Trade/MaterialData.h +++ b/src/Magnum/Trade/MaterialData.h @@ -2063,7 +2063,7 @@ class MAGNUM_TRADE_EXPORT MaterialData { * @ref MaterialData(MaterialTypes, DataFlags, Containers::ArrayView, const void*) * constructor instead. */ - explicit MaterialData(MaterialTypes types, Containers::Array&& attributeData, const void* importerState = nullptr) noexcept: MaterialData{types, std::move(attributeData), nullptr, importerState} {} + explicit MaterialData(MaterialTypes types, Containers::Array&& attributeData, const void* importerState = nullptr) noexcept: MaterialData{types, Utility::move(attributeData), nullptr, importerState} {} /** @overload */ /* Not noexcept because allocation happens inside */ @@ -2204,7 +2204,7 @@ class MAGNUM_TRADE_EXPORT MaterialData { * original instance then behaves the same as a moved-from instance. */ template T as() && { - return T{std::move(const_cast(as()))}; + return T{Utility::move(const_cast(as()))}; } #ifdef MAGNUM_BUILD_DEPRECATED diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index d0a88987c..04af97197 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -92,9 +92,9 @@ MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& inde _vertexDataFlags{DataFlag::Owned|DataFlag::Mutable}, _importerState{importerState}, _indices{static_cast(indices._data.data())}, - _attributes{std::move(attributes)}, - _indexData{std::move(indexData)}, - _vertexData{std::move(vertexData)} + _attributes{Utility::move(attributes)}, + _indexData{Utility::move(indexData)}, + _vertexData{Utility::move(vertexData)} { /* Save index count, only if the indices are actually specified */ if(_indexType != MeshIndexType{}) @@ -240,9 +240,9 @@ MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& inde #endif } -MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, Containers::Array&& vertexData, std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, std::move(indexData), indices, std::move(vertexData), Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} +MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, Containers::Array&& vertexData, std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, Utility::move(indexData), indices, Utility::move(vertexData), Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, const Containers::ArrayView vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(indexData.data())), indexData.size(), Implementation::nonOwnedArrayDeleter}, indices, Containers::Array{const_cast(static_cast(vertexData.data())), vertexData.size(), Implementation::nonOwnedArrayDeleter}, std::move(attributes), vertexCount, importerState} { +MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, const Containers::ArrayView vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(indexData.data())), indexData.size(), Implementation::nonOwnedArrayDeleter}, indices, Containers::Array{const_cast(static_cast(vertexData.data())), vertexData.size(), Implementation::nonOwnedArrayDeleter}, Utility::move(attributes), vertexCount, importerState} { CORRADE_ASSERT(!(indexDataFlags & DataFlag::Owned), "Trade::MeshData: can't construct with non-owned index data but" << indexDataFlags, ); CORRADE_ASSERT(!(vertexDataFlags & DataFlag::Owned), @@ -253,27 +253,27 @@ MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, const Containers::ArrayView vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, indexDataFlags, indexData, indices, vertexDataFlags, vertexData, Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, Containers::Array&& vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(indexData.data())), indexData.size(), Implementation::nonOwnedArrayDeleter}, indices, std::move(vertexData), std::move(attributes), vertexCount, importerState} { +MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, Containers::Array&& vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(indexData.data())), indexData.size(), Implementation::nonOwnedArrayDeleter}, indices, Utility::move(vertexData), Utility::move(attributes), vertexCount, importerState} { CORRADE_ASSERT(!(indexDataFlags & DataFlag::Owned), "Trade::MeshData: can't construct with non-owned index data but" << indexDataFlags, ); _indexDataFlags = indexDataFlags; } -MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, Containers::Array&& vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, indexDataFlags, indexData, indices, std::move(vertexData), Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} +MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, Containers::Array&& vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, indexDataFlags, indexData, indices, Utility::move(vertexData), Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, Containers::ArrayView vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, std::move(indexData), indices, Containers::Array{const_cast(static_cast(vertexData.data())), vertexData.size(), Implementation::nonOwnedArrayDeleter}, std::move(attributes), vertexCount, importerState} { +MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, Containers::ArrayView vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Utility::move(indexData), indices, Containers::Array{const_cast(static_cast(vertexData.data())), vertexData.size(), Implementation::nonOwnedArrayDeleter}, Utility::move(attributes), vertexCount, importerState} { CORRADE_ASSERT(!(vertexDataFlags & DataFlag::Owned), "Trade::MeshData: can't construct with non-owned vertex data but" << vertexDataFlags, ); _vertexDataFlags = vertexDataFlags; } -MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, const Containers::ArrayView vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, std::move(indexData), indices, vertexDataFlags, vertexData, Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} +MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, const DataFlags vertexDataFlags, const Containers::ArrayView vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, Utility::move(indexData), indices, vertexDataFlags, vertexData, Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, {}, MeshIndexData{}, std::move(vertexData), std::move(attributes), vertexCount, importerState} {} +MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, {}, MeshIndexData{}, Utility::move(vertexData), Utility::move(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, std::move(vertexData), Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} +MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& vertexData, const std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, Utility::move(vertexData), Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, const DataFlags vertexDataFlags, Containers::ArrayView vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(vertexData.data())), vertexData.size(), Implementation::nonOwnedArrayDeleter}, std::move(attributes), vertexCount, importerState} { +MeshData::MeshData(const MeshPrimitive primitive, const DataFlags vertexDataFlags, Containers::ArrayView vertexData, Containers::Array&& attributes, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(vertexData.data())), vertexData.size(), Implementation::nonOwnedArrayDeleter}, Utility::move(attributes), vertexCount, importerState} { CORRADE_ASSERT(!(vertexDataFlags & DataFlag::Owned), "Trade::MeshData: can't construct with non-owned vertex data but" << vertexDataFlags, ); _vertexDataFlags = vertexDataFlags; @@ -281,7 +281,7 @@ MeshData::MeshData(const MeshPrimitive primitive, const DataFlags vertexDataFlag MeshData::MeshData(const MeshPrimitive primitive, const DataFlags vertexDataFlags, Containers::ArrayView vertexData, std::initializer_list attributes, const UnsignedInt vertexCount, const void* const importerState): MeshData{primitive, vertexDataFlags, vertexData, Implementation::initializerListToArrayWithDefaultDeleter(attributes), vertexCount, importerState} {} -MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, std::move(indexData), indices, {}, {}, vertexCount, importerState} {} +MeshData::MeshData(const MeshPrimitive primitive, Containers::Array&& indexData, const MeshIndexData& indices, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Utility::move(indexData), indices, {}, {}, vertexCount, importerState} {} MeshData::MeshData(const MeshPrimitive primitive, const DataFlags indexDataFlags, const Containers::ArrayView indexData, const MeshIndexData& indices, const UnsignedInt vertexCount, const void* const importerState) noexcept: MeshData{primitive, Containers::Array{const_cast(static_cast(indexData.data())), indexData.size(), Implementation::nonOwnedArrayDeleter}, indices, vertexCount, importerState} { CORRADE_ASSERT(!(indexDataFlags & DataFlag::Owned), @@ -1079,18 +1079,18 @@ Containers::Array MeshData::objectIdsAsArray(const UnsignedInt id) Containers::Array MeshData::releaseIndexData() { _indexCount = 0; - Containers::Array out = std::move(_indexData); + Containers::Array out = Utility::move(_indexData); _indexData = Containers::Array{out.data(), 0, Implementation::nonOwnedArrayDeleter}; return out; } Containers::Array MeshData::releaseAttributeData() { - return std::move(_attributes); + return Utility::move(_attributes); } Containers::Array MeshData::releaseVertexData() { _vertexCount = 0; - Containers::Array out = std::move(_vertexData); + Containers::Array out = Utility::move(_vertexData); _vertexData = Containers::Array{out.data(), 0, Implementation::nonOwnedArrayDeleter}; return out; } diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index 768a812ee..c6cdf9593 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -786,7 +786,7 @@ Containers::Array sceneFieldDataNonOwningArray(const Containers: return Containers::Array{const_cast(view.data()), view.size(), Implementation::nonOwnedArrayDeleter}; } -SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mappingBound, Containers::Array&& data, Containers::Array&& fields, const void* const importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _mappingType{mappingType}, _dimensions{}, _mappingBound{mappingBound}, _importerState{importerState}, _fields{std::move(fields)}, _data{std::move(data)} { +SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mappingBound, Containers::Array&& data, Containers::Array&& fields, const void* const importerState) noexcept: _dataFlags{DataFlag::Owned|DataFlag::Mutable}, _mappingType{mappingType}, _dimensions{}, _mappingBound{mappingBound}, _importerState{importerState}, _fields{Utility::move(fields)}, _data{Utility::move(data)} { /* Check that mapping type is large enough */ CORRADE_ASSERT( (mappingType == SceneMappingType::UnsignedByte && mappingBound <= 0xffull) || @@ -1012,9 +1012,9 @@ SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mapp "Trade::SceneData: a skin field requires some transformation field to be present in order to disambiguate between 2D and 3D", ); } -SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mappingBound, Containers::Array&& data, const std::initializer_list fields, const void* const importerState): SceneData{mappingType, mappingBound, std::move(data), Implementation::initializerListToArrayWithDefaultDeleter(fields), importerState} {} +SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mappingBound, Containers::Array&& data, const std::initializer_list fields, const void* const importerState): SceneData{mappingType, mappingBound, Utility::move(data), Implementation::initializerListToArrayWithDefaultDeleter(fields), importerState} {} -SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mappingBound, const DataFlags dataFlags, const Containers::ArrayView data, Containers::Array&& fields, const void* const importerState) noexcept: SceneData{mappingType, mappingBound, Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, std::move(fields), importerState} { +SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mappingBound, const DataFlags dataFlags, const Containers::ArrayView data, Containers::Array&& fields, const void* const importerState) noexcept: SceneData{mappingType, mappingBound, Containers::Array{const_cast(static_cast(data.data())), data.size(), Implementation::nonOwnedArrayDeleter}, Utility::move(fields), importerState} { CORRADE_ASSERT(!(dataFlags & DataFlag::Owned), "Trade::SceneData: can't construct with non-owned data but" << dataFlags, ); _dataFlags = dataFlags; @@ -2904,13 +2904,13 @@ std::vector SceneData::children3D() const { #endif Containers::Array SceneData::releaseFieldData() { - Containers::Array out = std::move(_fields); + Containers::Array out = Utility::move(_fields); _fields = {}; return out; } Containers::Array SceneData::releaseData() { - Containers::Array out = std::move(_data); + Containers::Array out = Utility::move(_data); _data = {}; return out; } diff --git a/src/Magnum/Trade/SkinData.cpp b/src/Magnum/Trade/SkinData.cpp index 2aba40c32..c8af52ffe 100644 --- a/src/Magnum/Trade/SkinData.cpp +++ b/src/Magnum/Trade/SkinData.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Trade { -template SkinData::SkinData(Containers::Array&& jointData, Containers::Array>&& inverseBindMatrixData, const void* const importerState) noexcept: _jointData{std::move(jointData)}, _inverseBindMatrixData{std::move(inverseBindMatrixData)}, _importerState{importerState} { +template SkinData::SkinData(Containers::Array&& jointData, Containers::Array>&& inverseBindMatrixData, const void* const importerState) noexcept: _jointData{Utility::move(jointData)}, _inverseBindMatrixData{Utility::move(inverseBindMatrixData)}, _importerState{importerState} { CORRADE_ASSERT(_jointData.size() == _inverseBindMatrixData.size(), "Trade::SkinData: joint and inverse bind matrix arrays have different size, got" << _jointData.size() << "and" << _inverseBindMatrixData.size(), ); } @@ -48,11 +48,11 @@ template SkinData::~SkinData() = default; template SkinData& SkinData::operator=(SkinData&&) noexcept = default; template Containers::Array SkinData::releaseJointData() { - return std::move(_jointData); + return Utility::move(_jointData); } template Containers::Array> SkinData::releaseInverseBindMatrixData() { - return std::move(_inverseBindMatrixData); + return Utility::move(_inverseBindMatrixData); } #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/Magnum/Trade/Test/AbstractImporterTest.cpp b/src/Magnum/Trade/Test/AbstractImporterTest.cpp index 005cfaebf..00c87a487 100644 --- a/src/Magnum/Trade/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImporterTest.cpp @@ -2071,7 +2071,7 @@ void AbstractImporterTest::sceneDeprecatedFallback2D() { importerState[2] = {6, &c}; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data): _data{std::move(data)} {} + explicit Importer(SceneData&& data): _data{Utility::move(data)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -2105,7 +2105,7 @@ void AbstractImporterTest::sceneDeprecatedFallback2D() { private: SceneData _data; - } importer{SceneData{SceneMappingType::UnsignedInt, 7, std::move(data), { + } importer{SceneData{SceneMappingType::UnsignedInt, 7, Utility::move(data), { SceneFieldData{SceneField::Parent, transformations.slice(&Transform::object), transformations.slice(&Transform::parent)}, @@ -2343,7 +2343,7 @@ void AbstractImporterTest::sceneDeprecatedFallback3D() { importerState[2] = {6, &c}; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data): _data{std::move(data)} {} + explicit Importer(SceneData&& data): _data{Utility::move(data)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -2377,7 +2377,7 @@ void AbstractImporterTest::sceneDeprecatedFallback3D() { private: SceneData _data; - } importer{SceneData{SceneMappingType::UnsignedInt, 7, std::move(data), { + } importer{SceneData{SceneMappingType::UnsignedInt, 7, Utility::move(data), { SceneFieldData{SceneField::Parent, transformations.slice(&Transform::object), transformations.slice(&Transform::parent)}, @@ -2539,7 +2539,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackParentless2D() { Containers::StridedArrayView1D view = fields; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data): _data{std::move(data)} {} + explicit Importer(SceneData&& data): _data{Utility::move(data)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -2614,7 +2614,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackParentless3D() { Containers::StridedArrayView1D view = fields; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data): _data{std::move(data)} {} + explicit Importer(SceneData&& data): _data{Utility::move(data)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -2689,7 +2689,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackTransformless2D() { Containers::StridedArrayView1D view = fields; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data): _data{std::move(data)} {} + explicit Importer(SceneData&& data): _data{Utility::move(data)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -2795,7 +2795,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackTransformless3D() { Containers::StridedArrayView1D view = fields; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data): _data{std::move(data)} {} + explicit Importer(SceneData&& data): _data{Utility::move(data)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -2946,7 +2946,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects2D() { {30, 1, -1} }, meshesSecondary); - SceneData data{SceneMappingType::UnsignedInt, 32, std::move(dataData), { + SceneData data{SceneMappingType::UnsignedInt, 32, Utility::move(dataData), { SceneFieldData{SceneField::Parent, parents.slice(&Parent::object), parents.slice(&Parent::parent)}, SceneFieldData{SceneField::Mesh, meshes.slice(&Mesh::object), meshes.slice(&Mesh::mesh)}, SceneFieldData{SceneField::MeshMaterial, meshes.slice(&Mesh::object), meshes.slice(&Mesh::meshMaterial)}, @@ -2955,7 +2955,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects2D() { /* Just to disambiguate this as a 2D scene */ SceneFieldData{SceneField::Transformation, SceneMappingType::UnsignedInt, nullptr, SceneFieldType::Matrix3x3, nullptr}, }}; - SceneData dataSecondary{SceneMappingType::UnsignedInt, 31, std::move(dataDataSecondary), { + SceneData dataSecondary{SceneMappingType::UnsignedInt, 31, Utility::move(dataDataSecondary), { SceneFieldData{SceneField::Parent, parentsSecondary.slice(&Parent::object), parentsSecondary.slice(&Parent::parent)}, SceneFieldData{SceneField::Mesh, meshesSecondary.slice(&Mesh::object), meshesSecondary.slice(&Mesh::mesh)}, SceneFieldData{SceneField::MeshMaterial, meshesSecondary.slice(&Mesh::object), meshesSecondary.slice(&Mesh::meshMaterial)}, @@ -2964,7 +2964,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects2D() { }}; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data, SceneData&& dataSecondary): _data{std::move(data)}, _dataSecondary{std::move(dataSecondary)} {} + explicit Importer(SceneData&& data, SceneData&& dataSecondary): _data{Utility::move(data)}, _dataSecondary{Utility::move(dataSecondary)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -3002,7 +3002,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects2D() { private: SceneData _data, _dataSecondary; - } importer{std::move(data), std::move(dataSecondary)}; + } importer{Utility::move(data), Utility::move(dataSecondary)}; CORRADE_COMPARE(importer.sceneCount(), 4); @@ -3228,7 +3228,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects3D() { {30, 1, -1} }, meshesSecondary); - SceneData data{SceneMappingType::UnsignedInt, 32, std::move(dataData), { + SceneData data{SceneMappingType::UnsignedInt, 32, Utility::move(dataData), { SceneFieldData{SceneField::Parent, parents.slice(&Parent::object), parents.slice(&Parent::parent)}, SceneFieldData{SceneField::Mesh, meshes.slice(&Mesh::object), meshes.slice(&Mesh::mesh)}, SceneFieldData{SceneField::MeshMaterial, meshes.slice(&Mesh::object), meshes.slice(&Mesh::meshMaterial)}, @@ -3237,7 +3237,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects3D() { /* Just to disambiguate this as a 3D scene */ SceneFieldData{SceneField::Transformation, SceneMappingType::UnsignedInt, nullptr, SceneFieldType::Matrix4x4, nullptr}, }}; - SceneData dataSecondary{SceneMappingType::UnsignedInt, 31, std::move(dataDataSecondary), { + SceneData dataSecondary{SceneMappingType::UnsignedInt, 31, Utility::move(dataDataSecondary), { SceneFieldData{SceneField::Parent, parentsSecondary.slice(&Parent::object), parentsSecondary.slice(&Parent::parent)}, SceneFieldData{SceneField::Mesh, meshesSecondary.slice(&Mesh::object), meshesSecondary.slice(&Mesh::mesh)}, SceneFieldData{SceneField::MeshMaterial, meshesSecondary.slice(&Mesh::object), meshesSecondary.slice(&Mesh::meshMaterial)}, @@ -3246,7 +3246,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects3D() { }}; struct Importer: AbstractImporter { - explicit Importer(SceneData&& data, SceneData&& dataSecondary): _data{std::move(data)}, _dataSecondary{std::move(dataSecondary)} {} + explicit Importer(SceneData&& data, SceneData&& dataSecondary): _data{Utility::move(data)}, _dataSecondary{Utility::move(dataSecondary)} {} ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } @@ -3284,7 +3284,7 @@ void AbstractImporterTest::sceneDeprecatedFallbackMultiFunctionObjects3D() { private: SceneData _data, _dataSecondary; - } importer{std::move(data), std::move(dataSecondary)}; + } importer{Utility::move(data), Utility::move(dataSecondary)}; CORRADE_COMPARE(importer.sceneCount(), 4); @@ -4028,7 +4028,7 @@ void AbstractImporterTest::animationGrowableDeleters() { Containers::Optional doAnimation(UnsignedInt) override { Containers::Array data; Containers::arrayAppend(data, '\x37'); - return AnimationData{std::move(data), {AnimationTrackData{}}}; + return AnimationData{Utility::move(data), {AnimationTrackData{}}}; } } importer; @@ -5809,8 +5809,8 @@ void AbstractImporterTest::meshGrowableDeleters() { MeshAttributeData positions{MeshAttribute::Position, Containers::arrayView(vertexData)}; return MeshData{MeshPrimitive::Triangles, - std::move(indexData), indices, - Containers::arrayAllocatorCast(std::move(vertexData)), {positions}}; + Utility::move(indexData), indices, + Containers::arrayAllocatorCast(Utility::move(vertexData)), {positions}}; } } importer; @@ -6453,7 +6453,7 @@ void AbstractImporterTest::materialDeprecatedFallback() { propagating such instance works as well (array deleters etc.) */ Containers::Optional doMaterial(UnsignedInt) override { CORRADE_IGNORE_DEPRECATED_PUSH - return Containers::Optional{std::move(PhongMaterialData{{}, + return Containers::Optional{Utility::move(PhongMaterialData{{}, {}, {}, {}, {}, {}, {}, @@ -7094,7 +7094,7 @@ void AbstractImporterTest::image1DGrowableDeleter() { Containers::Optional doImage1D(UnsignedInt, UnsignedInt) override { Containers::Array data; Containers::arrayAppend(data, '\xff'); - return ImageData1D{PixelFormat::RGBA8Unorm, {}, std::move(data)}; + return ImageData1D{PixelFormat::RGBA8Unorm, {}, Utility::move(data)}; } } importer; @@ -7398,7 +7398,7 @@ void AbstractImporterTest::image2DGrowableDeleter() { Containers::Optional doImage2D(UnsignedInt, UnsignedInt) override { Containers::Array data; Containers::arrayAppend(data, '\xff'); - return ImageData2D{PixelFormat::RGBA8Unorm, {}, std::move(data)}; + return ImageData2D{PixelFormat::RGBA8Unorm, {}, Utility::move(data)}; } } importer; @@ -7702,7 +7702,7 @@ void AbstractImporterTest::image3DGrowableDeleter() { Containers::Optional doImage3D(UnsignedInt, UnsignedInt) override { Containers::Array data; Containers::arrayAppend(data, '\xff'); - return ImageData3D{PixelFormat::RGBA8Unorm, {}, std::move(data)}; + return ImageData3D{PixelFormat::RGBA8Unorm, {}, Utility::move(data)}; } } importer; diff --git a/src/Magnum/Trade/Test/AbstractSceneConverterTest.cpp b/src/Magnum/Trade/Test/AbstractSceneConverterTest.cpp index 1bba285cb..9ff0a1bbe 100644 --- a/src/Magnum/Trade/Test/AbstractSceneConverterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractSceneConverterTest.cpp @@ -1307,8 +1307,8 @@ void AbstractSceneConverterTest::convertMeshGrowableDeleters() { MeshAttributeData positions{MeshAttribute::Position, Containers::arrayView(vertexData)}; return MeshData{MeshPrimitive::Triangles, - std::move(indexData), indices, - Containers::arrayAllocatorCast(std::move(vertexData)), {positions}}; + Utility::move(indexData), indices, + Containers::arrayAllocatorCast(Utility::move(vertexData)), {positions}}; } char indexData[1]; @@ -1390,7 +1390,7 @@ void AbstractSceneConverterTest::convertMeshInPlace() { bool doConvertInPlace(MeshData& mesh) override { auto indices = mesh.mutableIndices(); for(std::size_t i = 0; i != indices.size()/2; ++i) - std::swap(indices[i], indices[indices.size() - i -1]); + Utility::swap(indices[i], indices[indices.size() - i -1]); return true; } } converter; @@ -1601,7 +1601,7 @@ void AbstractSceneConverterTest::convertMeshToDataGrowableDeleter() { Containers::arrayAppend(out, {'h', 'e', 'l', 'l', 'o'}); /* GCC 4.8 needs extra help here */ - return Containers::optional(std::move(out)); + return Containers::optional(Utility::move(out)); } } converter; diff --git a/src/Magnum/Trade/Test/AnimationDataTest.cpp b/src/Magnum/Trade/Test/AnimationDataTest.cpp index 172398fb2..44f17979d 100644 --- a/src/Magnum/Trade/Test/AnimationDataTest.cpp +++ b/src/Magnum/Trade/Test/AnimationDataTest.cpp @@ -686,7 +686,7 @@ void AnimationDataTest::construct() { view[2] = {7.5f, {1.0f, 0.3f, 2.1f}, Quaternion{}}; const int state = 5; - AnimationData data{std::move(buffer), { + AnimationData data{Utility::move(buffer), { AnimationTrackData{AnimationTrackTarget::Translation3D, 42, Animation::TrackView{ {view, &view[0].time, view.size(), sizeof(Data)}, @@ -754,7 +754,7 @@ void AnimationDataTest::constructImplicitDuration() { view[3] = {7.0f, false}; const int state = 5; - AnimationData data{std::move(buffer), { + AnimationData data{Utility::move(buffer), { AnimationTrackData{animationTrackTargetCustom(1), 0, Animation::TrackView{ {view, &view[0].time, 2, sizeof(Data)}, @@ -946,7 +946,7 @@ void AnimationDataTest::constructMove() { view[2] = {7.5f, {1.0f, 0.3f, 2.1f}, Quaternion{}}; const int state = 5; - AnimationData a{std::move(buffer), { + AnimationData a{Utility::move(buffer), { AnimationTrackData{AnimationTrackTarget::Translation3D, 42, Animation::TrackView{ {view, &view[0].time, view.size(), sizeof(Data)}, @@ -961,7 +961,7 @@ void AnimationDataTest::constructMove() { animationInterpolatorFor(Animation::Interpolation::Linear)}} }, {-1.0f, 7.0f}, &state}; - AnimationData b{std::move(a)}; + AnimationData b{Utility::move(a)}; CORRADE_COMPARE(b.duration(), (Range1D{-1.0f, 7.0f})); CORRADE_COMPARE(b.data().size(), sizeof(Data)*3); @@ -994,7 +994,7 @@ void AnimationDataTest::constructMove() { int other; AnimationData c{nullptr, nullptr, &other}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.duration(), (Range1D{-1.0f, 7.0f})); CORRADE_COMPARE(c.data().size(), sizeof(Data)*3); @@ -1066,7 +1066,7 @@ void AnimationDataTest::trackCustomResultType() { view[0] = {0.0f, {300, 100, 10}}; view[1] = {5.0f, {30, 60, 100}}; - AnimationData data{std::move(buffer), { + AnimationData data{Utility::move(buffer), { AnimationTrackData{AnimationTrackTarget::Scaling3D, 0, Animation::TrackView{ {view, &view[0].time, view.size(), sizeof(Data)}, diff --git a/src/Magnum/Trade/Test/CameraDataTest.cpp b/src/Magnum/Trade/Test/CameraDataTest.cpp index 43703086b..5e6888d3d 100644 --- a/src/Magnum/Trade/Test/CameraDataTest.cpp +++ b/src/Magnum/Trade/Test/CameraDataTest.cpp @@ -137,7 +137,7 @@ void CameraDataTest::constructMove() { const int a{}; CameraData data{CameraType::Perspective3D, 25.0_degf, 2.35f, 1.0f, 1000.0f, &a}; - CameraData b{std::move(data)}; + CameraData b{Utility::move(data)}; CORRADE_COMPARE(b.type(), CameraType::Perspective3D); CORRADE_COMPARE(b.size(), (Vector2{0.443389f, 0.188676f})); CORRADE_COMPARE(b.fov(), 25.0_degf); @@ -148,7 +148,7 @@ void CameraDataTest::constructMove() { const int c{}; CameraData d{CameraType::Orthographic3D, {2.0f, 1.0f}, 0.5f, 10.0f, &c}; - d = std::move(b); + d = Utility::move(b); CORRADE_COMPARE(b.type(), CameraType::Perspective3D); CORRADE_COMPARE(b.size(), (Vector2{0.443389f, 0.188676f})); CORRADE_COMPARE(b.fov(), 25.0_degf); diff --git a/src/Magnum/Trade/Test/ImageConverterTest.cpp b/src/Magnum/Trade/Test/ImageConverterTest.cpp index 860349549..621c77c55 100644 --- a/src/Magnum/Trade/Test/ImageConverterTest.cpp +++ b/src/Magnum/Trade/Test/ImageConverterTest.cpp @@ -121,7 +121,7 @@ Containers::Pair call(const Containers::StringIterable const Containers::Optional output = Utility::Path::readString(outputFilename); CORRADE_VERIFY(output); - return {success, std::move(*output)}; + return {success, Utility::move(*output)}; } #endif diff --git a/src/Magnum/Trade/Test/ImageDataTest.cpp b/src/Magnum/Trade/Test/ImageDataTest.cpp index 869574164..eb3c35f9b 100644 --- a/src/Magnum/Trade/Test/ImageDataTest.cpp +++ b/src/Magnum/Trade/Test/ImageDataTest.cpp @@ -720,7 +720,7 @@ void ImageDataTest::constructMoveGeneric() { int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */ ImageData2D a{PixelStorage{}.setAlignment(1), PixelFormat::RGBA32F, {1, 3}, Containers::Array{data, 3*16}, ImageFlag2D::Array, &state}; - ImageData2D b(std::move(a)); + ImageData2D b(Utility::move(a)); CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -739,7 +739,7 @@ void ImageDataTest::constructMoveGeneric() { auto data2 = new char[24]; ImageData2D c{PixelFormat::R8I, {2, 6}, Containers::Array{data2, 24}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), (Vector2i{2, 6})); @@ -765,7 +765,7 @@ void ImageDataTest::constructMoveImplementationSpecific() { int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */ ImageData2D a{PixelStorage{}.setAlignment(1), GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array{data, 3*6}, ImageFlag2D::Array, &state}; - ImageData2D b(std::move(a)); + ImageData2D b(Utility::move(a)); CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -785,7 +785,7 @@ void ImageDataTest::constructMoveImplementationSpecific() { auto data2 = new char[12*4*2]; ImageData2D c{PixelStorage{}, 1, 2, 8, {2, 6}, Containers::Array{data2, 12*4*2}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), Vector2i(2, 6)); @@ -809,7 +809,7 @@ void ImageDataTest::constructMoveCompressedGeneric() { ImageData2D a{ CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), CompressedPixelFormat::Bc3RGBAUnorm, {4, 4}, Containers::Array{data, 8}, ImageFlag2D::Array, &state}; - ImageData2D b{std::move(a)}; + ImageData2D b{Utility::move(a)}; CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -826,7 +826,7 @@ void ImageDataTest::constructMoveCompressedGeneric() { auto data2 = new char[16]; ImageData2D c{CompressedPixelFormat::Bc1RGBAUnorm, {8, 4}, Containers::Array{data2, 16}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), (Vector2i{8, 4})); @@ -848,7 +848,7 @@ void ImageDataTest::constructMoveCompressedImplementationSpecific() { ImageData2D a{ CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array{data, 8}, ImageFlag2D::Array, &state}; - ImageData2D b{std::move(a)}; + ImageData2D b{Utility::move(a)}; CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -865,7 +865,7 @@ void ImageDataTest::constructMoveCompressedImplementationSpecific() { auto data2 = new char[16]; ImageData2D c{CompressedPixelFormat::Bc2RGBAUnorm, {8, 4}, Containers::Array{data2, 16}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.data(), data2); CORRADE_COMPARE(b.size(), (Vector2i{8, 4})); @@ -887,7 +887,7 @@ void ImageDataTest::constructMoveAttachState() { int stateOld{}, stateNew{}; ImageData2D a{PixelStorage{}.setAlignment(1), GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array{data, 3*6}, ImageFlag2D::Array, &stateOld}; - ImageData2D b{std::move(a), &stateNew}; + ImageData2D b{Utility::move(a), &stateNew}; CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); @@ -912,7 +912,7 @@ void ImageDataTest::constructMoveCompressedAttachState() { ImageData2D a{ CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array{data, 8}, ImageFlag2D::Array, &stateOld}; - ImageData2D b{std::move(a), &stateNew}; + ImageData2D b{Utility::move(a), &stateNew}; CORRADE_COMPARE(a.data(), static_cast(nullptr)); CORRADE_COMPARE(a.size(), Vector2i{}); diff --git a/src/Magnum/Trade/Test/LightDataTest.cpp b/src/Magnum/Trade/Test/LightDataTest.cpp index a6fcc5c62..682d02947 100644 --- a/src/Magnum/Trade/Test/LightDataTest.cpp +++ b/src/Magnum/Trade/Test/LightDataTest.cpp @@ -409,7 +409,7 @@ void LightDataTest::constructMove() { 15.0_degf, 35.0_degf, &state}; - LightData b{std::move(a)}; + LightData b{Utility::move(a)}; CORRADE_COMPARE(b.type(), LightType::Spot); CORRADE_COMPARE(b.color(), 0xccff33_rgbf); CORRADE_COMPARE(b.intensity(), 0.8f); @@ -420,7 +420,7 @@ void LightDataTest::constructMove() { CORRADE_COMPARE(b.importerState(), &state); LightData c{{}, {}, {}}; - c = std::move(a); + c = Utility::move(a); CORRADE_COMPARE(c.type(), LightType::Spot); CORRADE_COMPARE(c.color(), 0xccff33_rgbf); CORRADE_COMPARE(c.intensity(), 0.8f); diff --git a/src/Magnum/Trade/Test/MaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp index 87df369e6..67353ebe1 100644 --- a/src/Magnum/Trade/Test/MaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/MaterialDataTest.cpp @@ -1144,7 +1144,7 @@ void MaterialDataTest::constructDuplicateAttribute() { std::ostringstream out; Error redirectError{&out}; - MaterialData data{{}, std::move(attributes), Containers::array({1, 1, 6})}; + MaterialData data{{}, Utility::move(attributes), Containers::array({1, 1, 6})}; /* Because with graceful asserts it doesn't exit on error, the assertion might get printed multiple times */ CORRADE_COMPARE(Utility::String::partition(out.str(), '\n')[0], "Trade::MaterialData: duplicate attribute DiffuseTextureCoordinates in layer 2"); @@ -1785,7 +1785,7 @@ void MaterialDataTest::constructMove() { 1, 1, 3 }, &state}; - MaterialData b{std::move(a)}; + MaterialData b{Utility::move(a)}; CORRADE_COMPARE(b.attributeDataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(b.layerDataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(a.layerCount(), 1); @@ -1799,7 +1799,7 @@ void MaterialDataTest::constructMove() { MaterialData c{MaterialTypes{}, { {MaterialAttribute::AlphaMask, 0.5f} }, {1}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.attributeCount(), 1); CORRADE_COMPARE(b.layerCount(), 1); CORRADE_COMPARE(c.attributeDataFlags(), DataFlag::Owned|DataFlag::Mutable); @@ -1851,13 +1851,13 @@ void MaterialDataTest::asRvalue() { 2, 4 }, &state}; - auto phong = std::move(data).as(); + auto phong = Utility::move(data).as(); CORRADE_COMPARE(data.layerCount(), 1); CORRADE_COMPARE(phong.layerCount(), 2); CORRADE_COMPARE(phong.diffuseColor(), 0xccffbbff_rgbaf); CORRADE_COMPARE(phong.attribute("ClearCoat", "highlightColor"), 0x335566ff_rgbaf); - auto specularGlossiness = std::move(phong).as(); + auto specularGlossiness = Utility::move(phong).as(); CORRADE_COMPARE(phong.layerCount(), 1); CORRADE_COMPARE(specularGlossiness.layerCount(), 2); CORRADE_COMPARE(specularGlossiness.diffuseColor(), 0xccffbbff_rgbaf); diff --git a/src/Magnum/Trade/Test/MeshDataTest.cpp b/src/Magnum/Trade/Test/MeshDataTest.cpp index 302775eb1..adc00bf96 100644 --- a/src/Magnum/Trade/Test/MeshDataTest.cpp +++ b/src/Magnum/Trade/Test/MeshDataTest.cpp @@ -1611,9 +1611,9 @@ void MeshDataTest::construct() { int importerState; MeshData data{MeshPrimitive::Triangles, - std::move(indexData), MeshIndexData{indices}, + Utility::move(indexData), MeshIndexData{indices}, /* Texture coordinates deliberately twice (though aliased) */ - std::move(vertexData), { + Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices.slice(&Vertex::position)}, MeshAttributeData{MeshAttribute::TextureCoordinates, @@ -2048,8 +2048,8 @@ void MeshDataTest::constructZeroIndices() { Containers::Array indexData{&i, 0, [](char*, std::size_t){}}; auto indices = Containers::arrayCast(indexData); MeshData data{MeshPrimitive::Triangles, - std::move(indexData), MeshIndexData{indices}, - std::move(vertexData), { + Utility::move(indexData), MeshIndexData{indices}, + Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices} }}; @@ -2070,8 +2070,8 @@ void MeshDataTest::constructZeroAttributes() { Containers::Array vertexData{3}; auto indices = Containers::arrayCast(indexData); MeshData data{MeshPrimitive::Triangles, - std::move(indexData), MeshIndexData{indices}, - std::move(vertexData), {}, 15}; + Utility::move(indexData), MeshIndexData{indices}, + Utility::move(vertexData), {}, 15}; CORRADE_COMPARE(data.indexCount(), 3); CORRADE_COMPARE(data.vertexDataFlags(), DataFlag::Owned|DataFlag::Mutable); @@ -2087,7 +2087,7 @@ void MeshDataTest::constructZeroVertices() { Containers::Array indexData{3*sizeof(UnsignedInt)}; auto indices = Containers::arrayCast(indexData); MeshData data{MeshPrimitive::Triangles, - std::move(indexData), MeshIndexData{indices}, + Utility::move(indexData), MeshIndexData{indices}, nullptr, { MeshAttributeData{MeshAttribute::Position, VertexFormat::Vector3, nullptr} }}; @@ -2112,7 +2112,7 @@ void MeshDataTest::constructIndexless() { }, vertices); int importerState; - MeshData data{MeshPrimitive::LineLoop, std::move(vertexData), { + MeshData data{MeshPrimitive::LineLoop, Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices} }, MeshData::ImplicitVertexCount, &importerState}; CORRADE_COMPARE(data.indexDataFlags(), DataFlag::Owned|DataFlag::Mutable); @@ -2159,7 +2159,7 @@ void MeshDataTest::constructAttributeless() { int importerState; MeshData data{MeshPrimitive::TriangleStrip, - std::move(indexData), MeshIndexData{indices}, + Utility::move(indexData), MeshIndexData{indices}, 3, &importerState}; /* These are empty so it doesn't matter, but this is a nice non-restrictive default */ @@ -2302,7 +2302,7 @@ void MeshDataTest::constructSpecialIndexStrides() { Containers::Array indexData{sizeof(UnsignedShort)*8}; Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Utility::copy({1, 0, 2, 0, 3, 0, 4, 0}, indices); - MeshData mesh{MeshPrimitive::Points, std::move(indexData), + MeshData mesh{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{indices.every(2)}, 1}; CORRADE_COMPARE(mesh.indexStride(), 4); @@ -2334,7 +2334,7 @@ void MeshDataTest::constructSpecialIndexStrides() { Containers::Array indexData{sizeof(UnsignedShort)}; Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); indices[0] = 15; - MeshData mesh{MeshPrimitive::Points, std::move(indexData), + MeshData mesh{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{indices.broadcasted<0>(4)}, 1}; CORRADE_COMPARE(mesh.indexStride(), 0); @@ -2366,7 +2366,7 @@ void MeshDataTest::constructSpecialIndexStrides() { Containers::Array indexData{sizeof(UnsignedShort)*4}; Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Utility::copy({1, 2, 3, 4}, indices); - MeshData mesh{MeshPrimitive::Points, std::move(indexData), + MeshData mesh{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{indices.flipped<0>()}, 1}; CORRADE_COMPARE(mesh.indexStride(), -2); @@ -2405,7 +2405,7 @@ void MeshDataTest::constructSpecialIndexStridesImplementationSpecificIndexType() Containers::Array indexData{sizeof(UnsignedShort)*8}; Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Utility::copy({1, 0, 2, 0, 3, 0, 4, 0}, indices); - MeshData mesh{MeshPrimitive::Points, std::move(indexData), + MeshData mesh{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{meshIndexTypeWrap(0xcaca), indices.every(2)}, 1}; CORRADE_COMPARE(mesh.indexStride(), 4); @@ -2429,7 +2429,7 @@ void MeshDataTest::constructSpecialIndexStridesImplementationSpecificIndexType() Containers::Array indexData{sizeof(UnsignedShort)}; Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); indices[0] = 15; - MeshData mesh{MeshPrimitive::Points, std::move(indexData), + MeshData mesh{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{meshIndexTypeWrap(0xcaca), indices.broadcasted<0>(4)}, 1}; CORRADE_COMPARE(mesh.indexStride(), 0); @@ -2449,7 +2449,7 @@ void MeshDataTest::constructSpecialIndexStridesImplementationSpecificIndexType() Containers::Array indexData{sizeof(UnsignedShort)*4}; Containers::StridedArrayView1D indices = Containers::arrayCast(indexData); Utility::copy({1, 2, 3, 4}, indices); - MeshData mesh{MeshPrimitive::Points, std::move(indexData), + MeshData mesh{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{meshIndexTypeWrap(0xcaca), indices.flipped<0>()}, 1}; CORRADE_COMPARE(mesh.indexStride(), -2); @@ -2472,7 +2472,7 @@ void MeshDataTest::constructSpecialAttributeStrides() { Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Utility::copy({15, 1, 2, 3, 4}, vertices); - MeshData mesh{MeshPrimitive::Points, std::move(vertexData), { + MeshData mesh{MeshPrimitive::Points, Utility::move(vertexData), { MeshAttributeData{MeshAttribute::ObjectId, vertices.prefix(1).broadcasted<0>(4)}, MeshAttributeData{MeshAttribute::ObjectId, @@ -2530,7 +2530,7 @@ void MeshDataTest::constructSpecialAttributeStridesImplementationSpecificVertexF Containers::StridedArrayView1D vertices = Containers::arrayCast(vertexData); Utility::copy({15, 1, 2, 3, 4}, vertices); - MeshData mesh{MeshPrimitive::Points, std::move(vertexData), { + MeshData mesh{MeshPrimitive::Points, Utility::move(vertexData), { MeshAttributeData{MeshAttribute::ObjectId, vertexFormatWrap(0xdead), vertices.prefix(1).broadcasted<0>(4)}, MeshAttributeData{MeshAttribute::ObjectId, vertexFormatWrap(0xdead), @@ -2626,7 +2626,7 @@ void MeshDataTest::constructIndicesNotOwned() { int importerState; MeshData data{MeshPrimitive::Triangles, instanceData.dataFlags, indices, MeshIndexData{indices}, - std::move(vertexData), { + Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices} }, MeshData::ImplicitVertexCount, &importerState}; @@ -2674,7 +2674,7 @@ void MeshDataTest::constructVerticesNotOwned() { int importerState; MeshData data{MeshPrimitive::Triangles, - std::move(indexData), MeshIndexData{indices}, + Utility::move(indexData), MeshIndexData{indices}, instanceData.dataFlags, vertices, { MeshAttributeData{MeshAttribute::Position, Containers::arrayView(vertices)} @@ -2810,7 +2810,7 @@ void MeshDataTest::constructIndexDataButNotIndexed() { std::ostringstream out; Error redirectError{&out}; - MeshData{MeshPrimitive::Points, std::move(indexData), MeshIndexData{}, nullptr, {positions}}; + MeshData{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{}, nullptr, {positions}}; CORRADE_COMPARE(out.str(), "Trade::MeshData: indexData passed for a non-indexed mesh\n"); } @@ -2844,7 +2844,7 @@ void MeshDataTest::constructIndicesNotContained() { std::ostringstream out; Error redirectError{&out}; /* Basic "obviously wrong" case with owned index data */ - MeshData{MeshPrimitive::Triangles, std::move(sameIndexDataButMovable), MeshIndexData{indexDataOut}, 1}; + MeshData{MeshPrimitive::Triangles, Utility::move(sameIndexDataButMovable), MeshIndexData{indexDataOut}, 1}; /* A "slightly off" view that exceeds the original by one byte */ MeshData{MeshPrimitive::Triangles, {}, indexData, MeshIndexData{indexDataSlightlyOut}, 1}; /* A strided index array which would pass if stride wasn't taken into @@ -2916,7 +2916,7 @@ void MeshDataTest::constructAttributeNotContained() { std::ostringstream out; Error redirectError{&out}; /* Basic "obviously wrong" case with owned vertex data */ - MeshData{MeshPrimitive::Triangles, std::move(sameVertexDataButMovable), { + MeshData{MeshPrimitive::Triangles, Utility::move(sameVertexDataButMovable), { /* This is here to test that not just the first attribute gets checked and that the message shows proper ID */ MeshAttributeData{MeshAttribute::Position, vertexDataIn}, @@ -3005,7 +3005,7 @@ void MeshDataTest::constructInconsitentVertexCount() { count. However, the actual "containment" of the attribute views is checked with the explicit vertex count -- see the constructAttributeNotContained() test above. */ - MeshData{MeshPrimitive::Triangles, std::move(vertexData), {positions, positions2}, 17}; + MeshData{MeshPrimitive::Triangles, Utility::move(vertexData), {positions, positions2}, 17}; CORRADE_COMPARE(out.str(), "Trade::MeshData: attribute 1 has 2 vertices but 3 expected\n"); } @@ -3111,7 +3111,7 @@ void MeshDataTest::constructIndicesNotOwnedFlagOwned() { std::ostringstream out; Error redirectError{&out}; - MeshData data{MeshPrimitive::Triangles, DataFlag::Owned, indexData, indices, std::move(vertexData), {positions}}; + MeshData data{MeshPrimitive::Triangles, DataFlag::Owned, indexData, indices, Utility::move(vertexData), {positions}}; CORRADE_COMPARE(out.str(), "Trade::MeshData: can't construct with non-owned index data but Trade::DataFlag::Owned\n"); } @@ -3130,7 +3130,7 @@ void MeshDataTest::constructVerticesNotOwnedFlagOwned() { std::ostringstream out; Error redirectError{&out}; - MeshData data{MeshPrimitive::Triangles, std::move(indexData), indices, DataFlag::Owned, vertexData, {positions}}; + MeshData data{MeshPrimitive::Triangles, Utility::move(indexData), indices, DataFlag::Owned, vertexData, {positions}}; CORRADE_COMPARE(out.str(), "Trade::MeshData: can't construct with non-owned vertex data but Trade::DataFlag::Owned\n"); } @@ -3196,13 +3196,13 @@ void MeshDataTest::constructMove() { int importerState; MeshData a{MeshPrimitive::Triangles, - std::move(indexData), MeshIndexData{indices}, - std::move(vertexData), { + Utility::move(indexData), MeshIndexData{indices}, + Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices} }, MeshData::ImplicitVertexCount, &importerState}; - MeshData b{std::move(a)}; + MeshData b{Utility::move(a)}; CORRADE_COMPARE(b.indexDataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(b.vertexDataFlags(), DataFlag::Owned|DataFlag::Mutable); @@ -3227,7 +3227,7 @@ void MeshDataTest::constructMove() { CORRADE_COMPARE(b.attribute(0)[1], (Vector2{0.4f, 0.5f})); MeshData c{MeshPrimitive::LineLoop, 37}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.indexDataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(c.vertexDataFlags(), DataFlag::Owned|DataFlag::Mutable); @@ -4443,7 +4443,7 @@ void MeshDataTest::indicesWrongType() { Containers::Array indexData{sizeof(UnsignedShort)}; auto indices = Containers::arrayCast(indexData); indices[0] = 57616; - MeshData data{MeshPrimitive::Points, std::move(indexData), MeshIndexData{indices}, 57617}; + MeshData data{MeshPrimitive::Points, Utility::move(indexData), MeshIndexData{indices}, 57617}; std::ostringstream out; Error redirectError{&out}; @@ -4681,7 +4681,7 @@ void MeshDataTest::releaseIndexData() { Containers::Array indexData{23}; auto indices = Containers::arrayCast(indexData.slice(6, 12)); - MeshData data{MeshPrimitive::TriangleStrip, std::move(indexData), MeshIndexData{indices}, 10}; + MeshData data{MeshPrimitive::TriangleStrip, Utility::move(indexData), MeshIndexData{indices}, 10}; CORRADE_VERIFY(data.isIndexed()); CORRADE_COMPARE(data.indexCount(), 3); CORRADE_COMPARE(data.indexOffset(), 6); @@ -4701,7 +4701,7 @@ void MeshDataTest::releaseAttributeData() { Containers::Array vertexData{16}; auto vertices = Containers::arrayCast(vertexData); - MeshData data{MeshPrimitive::LineLoop, std::move(vertexData), { + MeshData data{MeshPrimitive::LineLoop, Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices}, MeshAttributeData{MeshAttribute::Position, vertices} }}; @@ -4723,7 +4723,7 @@ void MeshDataTest::releaseVertexData() { Containers::Array vertexData{80}; auto vertices = Containers::arrayCast(vertexData.slice(48, 72)); - MeshData data{MeshPrimitive::LineLoop, std::move(vertexData), { + MeshData data{MeshPrimitive::LineLoop, Utility::move(vertexData), { MeshAttributeData{MeshAttribute::Position, vertices}, MeshAttributeData{MeshAttribute::Position, vertices} }}; diff --git a/src/Magnum/Trade/Test/SceneDataTest.cpp b/src/Magnum/Trade/Test/SceneDataTest.cpp index 91cca8c3b..8cbb6e6f0 100644 --- a/src/Magnum/Trade/Test/SceneDataTest.cpp +++ b/src/Magnum/Trade/Test/SceneDataTest.cpp @@ -2517,7 +2517,7 @@ void SceneDataTest::construct() { SceneFieldData radiuses{sceneFieldCustom(37), materialMeshRadiusMappingData, Containers::arrayCast<2, Float>(radiusFieldData), SceneFieldFlag::OrderedMapping}; - SceneData scene{SceneMappingType::UnsignedShort, 8, std::move(data), { + SceneData scene{SceneMappingType::UnsignedShort, 8, Utility::move(data), { transformations, parents, meshes, radiuses }, &importerState}; @@ -3203,7 +3203,7 @@ template void SceneDataTest::constructString() { to test storing negative string data offset */ CORRADE_VERIFY(fileTagStringData.data() < fileTagData.data()); - SceneData scene{SceneMappingType::UnsignedShort, 4, std::move(data), { + SceneData scene{SceneMappingType::UnsignedShort, 4, Utility::move(data), { /* Has a negative stride */ SceneFieldData{nameField, nameData.slice(&Name::object).template flipped<0>(), nameKeyValueStringData.data(), StringFieldTraits::offsetType(), @@ -3394,7 +3394,7 @@ void SceneDataTest::constructSpecialStrides() { SceneFieldData flippedFieldOffsetOnly{sceneFieldCustom(41), 4, SceneMappingType::UnsignedShort, std::size_t(static_cast(nonBroadcastedData.flipped<0>().data()) - data.data()), -2, SceneFieldType::UnsignedShort, std::size_t(static_cast(nonBroadcastedData.flipped<0>().data()) - data.data()), -2}; - SceneData scene{SceneMappingType::UnsignedShort, 8, std::move(data), { + SceneData scene{SceneMappingType::UnsignedShort, 8, Utility::move(data), { broadcastedMapping, broadcastedField, flippedField, flippedFieldOffsetOnly }}; @@ -3662,7 +3662,7 @@ void SceneDataTest::constructMappingDataNotContained() { std::ostringstream out; Error redirectError{&out}; /* Basic "obviously wrong" case with owned data */ - SceneData{SceneMappingType::UnsignedShort, 5, std::move(sameDataButMovable), { + SceneData{SceneMappingType::UnsignedShort, 5, Utility::move(sameDataButMovable), { /* This is here to test that not just the first field gets checked and that the message shows proper ID */ SceneFieldData{SceneField::Light, dataIn, dataIn}, @@ -3717,7 +3717,7 @@ void SceneDataTest::constructFieldDataNotContained() { std::ostringstream out; Error redirectError{&out}; /* Basic "obviously wrong" case with owned data */ - SceneData{SceneMappingType::UnsignedShort, 5, std::move(sameDataButMovable), { + SceneData{SceneMappingType::UnsignedShort, 5, Utility::move(sameDataButMovable), { /* This is here to test that not just the first attribute gets checked and that the message shows proper ID */ SceneFieldData{SceneField::Light, dataIn, dataIn}, @@ -3782,7 +3782,7 @@ void SceneDataTest::constructBitFieldDataNotContained() { std::ostringstream out; Error redirectError{&out}; /* Basic "obviously wrong" case with owned data */ - SceneData{SceneMappingType::UnsignedByte, 10, std::move(sameDataButMovable), { + SceneData{SceneMappingType::UnsignedByte, 10, Utility::move(sameDataButMovable), { /* This is here to test that not just the first attribute gets checked and that the message shows proper ID */ SceneFieldData{SceneField::Light, mappingData, mappingData}, @@ -4214,9 +4214,9 @@ void SceneDataTest::constructMove() { int importerState; SceneFieldData meshes{SceneField::Mesh, stridedArrayView(meshData).slice(&Mesh::object), stridedArrayView(meshData).slice(&Mesh::mesh)}; - SceneData a{SceneMappingType::UnsignedShort, 15, std::move(data), {meshes}, &importerState}; + SceneData a{SceneMappingType::UnsignedShort, 15, Utility::move(data), {meshes}, &importerState}; - SceneData b{std::move(a)}; + SceneData b{Utility::move(a)}; CORRADE_COMPARE(b.dataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(b.mappingBound(), 15); CORRADE_COMPARE(b.mappingType(), SceneMappingType::UnsignedShort); @@ -4231,7 +4231,7 @@ void SceneDataTest::constructMove() { CORRADE_COMPARE(b.field(0)[2], 2); SceneData c{SceneMappingType::UnsignedByte, 76, nullptr, {}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.dataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(c.mappingBound(), 15); CORRADE_COMPARE(c.mappingType(), SceneMappingType::UnsignedShort); @@ -4717,7 +4717,7 @@ template void SceneDataTest::transformations2DAsArray() { for those and error/warn on those, they get just ignored. */ components[1] = {2, {3.5f, -1.0f}, {1.0f, 1.5f}}; - SceneData scene{SceneMappingType::UnsignedInt, 6, std::move(data), { + SceneData scene{SceneMappingType::UnsignedInt, 6, Utility::move(data), { /* To verify it isn't just picking the first ever field */ SceneFieldData{SceneField::Parent, SceneMappingType::UnsignedInt, nullptr, SceneFieldType::Int, nullptr}, SceneFieldData{SceneField::Transformation, @@ -5313,7 +5313,7 @@ template void SceneDataTest::transformations3DAsArray() { for those and error/warn on those, they get just ignored. */ components[1] = {2, {3.5f, -1.0f, 2.2f}, {1.0f, 1.5f, 1.0f}}; - SceneData scene{SceneMappingType::UnsignedInt, 6, std::move(data), { + SceneData scene{SceneMappingType::UnsignedInt, 6, Utility::move(data), { /* To verify it isn't just picking the first ever field */ SceneFieldData{SceneField::Parent, SceneMappingType::UnsignedInt, nullptr, SceneFieldType::Int, nullptr}, SceneFieldData{SceneField::Transformation, @@ -7530,7 +7530,7 @@ void SceneDataTest::childrenDeprecated() { if(data.is3D) arrayAppend(fieldData, SceneFieldData{SceneField::Translation, SceneMappingType::UnsignedByte, nullptr, SceneFieldType::Vector3, nullptr}); - SceneData scene{SceneMappingType::UnsignedByte, 25, {}, fields, std::move(fieldData)}; + SceneData scene{SceneMappingType::UnsignedByte, 25, {}, fields, Utility::move(fieldData)}; if(!data.skipParent) { CORRADE_IGNORE_DEPRECATED_PUSH @@ -7644,7 +7644,7 @@ void SceneDataTest::releaseFieldData() { }); SceneFieldData* originalFields = fields; - SceneData scene{SceneMappingType::UnsignedByte, 50, std::move(data), std::move(fields)}; + SceneData scene{SceneMappingType::UnsignedByte, 50, Utility::move(data), Utility::move(fields)}; Containers::Array released = scene.releaseFieldData(); CORRADE_COMPARE(released.data(), originalFields); @@ -7670,7 +7670,7 @@ void SceneDataTest::releaseData() { Containers::Array data{NoInit, 3*sizeof(Field)}; Containers::StridedArrayView1D view = Containers::arrayCast(data); - SceneData scene{SceneMappingType::UnsignedByte, 50, std::move(data), { + SceneData scene{SceneMappingType::UnsignedByte, 50, Utility::move(data), { SceneFieldData{SceneField::Parent, SceneMappingType::UnsignedByte, nullptr, SceneFieldType::Int, nullptr}, SceneFieldData{SceneField::Mesh, view.slice(&Field::object), view.slice(&Field::mesh)} }}; diff --git a/src/Magnum/Trade/Test/SkinDataTest.cpp b/src/Magnum/Trade/Test/SkinDataTest.cpp index 0e9d5ee70..21c456975 100644 --- a/src/Magnum/Trade/Test/SkinDataTest.cpp +++ b/src/Magnum/Trade/Test/SkinDataTest.cpp @@ -107,13 +107,13 @@ void SkinDataTest::constructMove() { Matrix4::translation(Vector3::zAxis(4.0f)), }, &state}; - SkinData3D b = std::move(a); + SkinData3D b = Utility::move(a); CORRADE_COMPARE(b.joints()[1], 2); CORRADE_COMPARE(b.inverseBindMatrices()[1], Matrix4::translation(Vector3::zAxis(2.0f))); CORRADE_COMPARE(b.importerState(), &state); SkinData3D c{{}, {}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.joints()[1], 2); CORRADE_COMPARE(c.inverseBindMatrices()[1], Matrix4::translation(Vector3::zAxis(2.0f))); CORRADE_COMPARE(c.importerState(), &state); @@ -133,7 +133,7 @@ void SkinDataTest::release() { const void* jointsPointer = joints; const void* inverseBindMatricesPointer = inverseBindMatrices; - SkinData2D data{std::move(joints), std::move(inverseBindMatrices)}; + SkinData2D data{Utility::move(joints), Utility::move(inverseBindMatrices)}; Containers::Array releasedJoints = data.releaseJointData(); CORRADE_COMPARE(data.joints().size(), 0); diff --git a/src/Magnum/Trade/Test/TextureDataTest.cpp b/src/Magnum/Trade/Test/TextureDataTest.cpp index 2dd2af058..f61264735 100644 --- a/src/Magnum/Trade/Test/TextureDataTest.cpp +++ b/src/Magnum/Trade/Test/TextureDataTest.cpp @@ -85,7 +85,7 @@ void TextureDataTest::constructMove() { 42, &a}; - TextureData b{std::move(data)}; + TextureData b{Utility::move(data)}; CORRADE_COMPARE(b.type(), TextureType::CubeMap); CORRADE_COMPARE(b.minificationFilter(), SamplerFilter::Linear); @@ -103,7 +103,7 @@ void TextureDataTest::constructMove() { SamplerWrapping::ClampToEdge, 13, &c}; - d = std::move(b); + d = Utility::move(b); CORRADE_COMPARE(d.type(), TextureType::CubeMap); CORRADE_COMPARE(d.minificationFilter(), SamplerFilter::Linear); diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index ef99c31db..214f76041 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -374,7 +374,7 @@ template bool convertImages(Trade::AbstractImageConverte for(Trade::ImageData& image: images) { Containers::Optional> output = converter.convert(image); if(!output) return false; - image = *std::move(output); + image = *Utility::move(output); } return true; @@ -613,7 +613,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") /* Fake a mutable array with a non-owning deleter to have the same type as from Path::read(). The actual memory is owned by the `mapped` array. */ - mapped.back() = *std::move(mappedMaybe); + mapped.back() = *Utility::move(mappedMaybe); data = Containers::Array{const_cast(mapped.back().data()), mapped.back().size(), [](char*, std::size_t){}}; } else #endif @@ -625,7 +625,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") return 3; } - data = *std::move(dataMaybe); + data = *Utility::move(dataMaybe); } auto side = Int(std::sqrt(data.size()/pixelSize)); @@ -645,7 +645,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") return 0; } - arrayAppend(images2D, InPlaceInit, format, Vector2i{side}, std::move(data)); + arrayAppend(images2D, InPlaceInit, format, Vector2i{side}, Utility::move(data)); /* Otherwise load it using an importer plugin */ } else { @@ -671,7 +671,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") return 3; } - mapped.back() = *std::move(mappedMaybe); + mapped.back() = *Utility::move(mappedMaybe); } else #endif { @@ -747,7 +747,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") /* The --layer option is only for 2D/3D, not checking any bounds here. If the option is present, the extraction code below will fail. */ - arrayAppend(images1D, std::move(*image1D)); + arrayAppend(images1D, Utility::move(*image1D)); imported = true; } } @@ -788,7 +788,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") return 1; } - arrayAppend(images2D, std::move(*image2D)); + arrayAppend(images2D, Utility::move(*image2D)); imported = true; } } @@ -829,7 +829,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") return 1; } - arrayAppend(images3D, std::move(*image3D)); + arrayAppend(images3D, Utility::move(*image3D)); imported = true; } } @@ -958,7 +958,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") images2D[i].pixelSize(), images2D[i].size().x(), Containers::Array{NoInit, std::size_t(images2D[i].size().x()*images2D[i].pixelSize())}}; Utility::copy(images2D[i].pixels()[layer], copy.mutablePixels()); - arrayAppend(outputImages1D, std::move(copy)); + arrayAppend(outputImages1D, Utility::move(copy)); } } else { @@ -988,7 +988,7 @@ no -C / --converter is specified, AnyImageConverter is used.)") images3D[i].pixelSize(), images3D[i].size().xy(), Containers::Array{NoInit, std::size_t(images3D[i].size().xy().product()*images3D[i].pixelSize())}}; Utility::copy(images3D[i].pixels()[layer], copy.mutablePixels()); - arrayAppend(outputImages2D, std::move(copy)); + arrayAppend(outputImages2D, Utility::move(copy)); } } else { @@ -1005,15 +1005,15 @@ no -C / --converter is specified, AnyImageConverter is used.)") if(dimensions == 1) { if(!checkCommonFormatFlags(args, images1D)) return 1; outputDimensions = 1; - outputImages1D = std::move(images1D); + outputImages1D = Utility::move(images1D); } else if(dimensions == 2) { if(!checkCommonFormatFlags(args, images2D)) return 1; outputDimensions = 2; - outputImages2D = std::move(images2D); + outputImages2D = Utility::move(images2D); } else if(dimensions == 3) { if(!checkCommonFormatFlags(args, images3D)) return 1; outputDimensions = 3; - outputImages3D = std::move(images3D); + outputImages3D = Utility::move(images3D); } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); } diff --git a/src/Magnum/Vk/Buffer.cpp b/src/Magnum/Vk/Buffer.cpp index a4841d1cf..6b9a16cbc 100644 --- a/src/Magnum/Vk/Buffer.cpp +++ b/src/Magnum/Vk/Buffer.cpp @@ -77,7 +77,7 @@ Buffer::Buffer(Device& device, const BufferCreateInfo& info, const MemoryFlags m Buffer::Buffer(NoCreateT): _device{}, _handle{}, _dedicatedMemory{NoCreate} {} -Buffer::Buffer(Buffer&& other) noexcept: _device{other._device}, _handle{other._handle}, _flags{other._flags}, _dedicatedMemory{std::move(other._dedicatedMemory)} { +Buffer::Buffer(Buffer&& other) noexcept: _device{other._device}, _handle{other._handle}, _flags{other._flags}, _dedicatedMemory{Utility::move(other._dedicatedMemory)} { other._handle = {}; } @@ -87,7 +87,7 @@ Buffer::~Buffer() { } Buffer& Buffer::operator=(Buffer&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); @@ -115,7 +115,7 @@ void Buffer::bindMemory(Memory& memory, const UnsignedLong offset) { void Buffer::bindDedicatedMemory(Memory&& memory) { bindMemory(memory, 0); - _dedicatedMemory = std::move(memory); + _dedicatedMemory = Utility::move(memory); } bool Buffer::hasDedicatedMemory() const { diff --git a/src/Magnum/Vk/CommandBuffer.cpp b/src/Magnum/Vk/CommandBuffer.cpp index 16211aa02..1e3b69343 100644 --- a/src/Magnum/Vk/CommandBuffer.cpp +++ b/src/Magnum/Vk/CommandBuffer.cpp @@ -54,7 +54,7 @@ CommandBuffer::~CommandBuffer() { } CommandBuffer& CommandBuffer::operator=(CommandBuffer&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._pool, _pool); swap(other._handle, _handle); diff --git a/src/Magnum/Vk/CommandPool.cpp b/src/Magnum/Vk/CommandPool.cpp index 66e82f261..029c37524 100644 --- a/src/Magnum/Vk/CommandPool.cpp +++ b/src/Magnum/Vk/CommandPool.cpp @@ -70,7 +70,7 @@ CommandPool::~CommandPool() { } CommandPool& CommandPool::operator=(CommandPool&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/DescriptorPool.cpp b/src/Magnum/Vk/DescriptorPool.cpp index f71ed31e7..2accaf0f5 100644 --- a/src/Magnum/Vk/DescriptorPool.cpp +++ b/src/Magnum/Vk/DescriptorPool.cpp @@ -78,7 +78,7 @@ DescriptorPoolCreateInfo::DescriptorPoolCreateInfo(DescriptorPoolCreateInfo&& ot /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _data{std::move(other._data)} + _data{Utility::move(other._data)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -91,7 +91,7 @@ DescriptorPoolCreateInfo::DescriptorPoolCreateInfo(DescriptorPoolCreateInfo&& ot DescriptorPoolCreateInfo::~DescriptorPoolCreateInfo() = default; DescriptorPoolCreateInfo& DescriptorPoolCreateInfo::operator=(DescriptorPoolCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._data, _data); return *this; @@ -121,7 +121,7 @@ DescriptorPool::~DescriptorPool() { } DescriptorPool& DescriptorPool::operator=(DescriptorPool&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); @@ -158,20 +158,20 @@ Containers::Pair DescriptorPool::allocateInternal(const V contemporary drivers in early 2021 do this, there's nothing I can do otherwise. */ const Result result = MAGNUM_VK_INTERNAL_ASSERT_SUCCESS_OR((**_device).AllocateDescriptorSets(*_device, &info, &set._handle), Result::ErrorOutOfPoolMemory, Result::ErrorFragmentedPool); - return {result, std::move(set)}; + return {result, Utility::move(set)}; } DescriptorSet DescriptorPool::allocate(const VkDescriptorSetLayout layout) { Containers::Pair out = allocateInternal(layout); CORRADE_ASSERT(out.first() == Result::Success, - "Vk::DescriptorPool::allocate(): allocation failed with" << out.first(), std::move(out.second())); - return std::move(out.second()); + "Vk::DescriptorPool::allocate(): allocation failed with" << out.first(), Utility::move(out.second())); + return Utility::move(out.second()); } Containers::Optional DescriptorPool::tryAllocate(const VkDescriptorSetLayout layout) { Containers::Pair out = allocateInternal(layout); if(out.first() != Result::Success) return {}; - return std::move(out.second()); + return Utility::move(out.second()); } Containers::Pair DescriptorPool::allocateInternal(const VkDescriptorSetLayout layout, const UnsignedInt variableDescriptorCount) { @@ -194,20 +194,20 @@ Containers::Pair DescriptorPool::allocateInternal(const V /* See the not about VK_ERROR_OUT_OF_POOL_MEMORY and VK_KHR_maintenance1 in the other allocateInternal() implementation above. */ const Result result = MAGNUM_VK_INTERNAL_ASSERT_SUCCESS_OR((**_device).AllocateDescriptorSets(*_device, &info, &set._handle), Result::ErrorOutOfPoolMemory, Result::ErrorFragmentedPool); - return {result, std::move(set)}; + return {result, Utility::move(set)}; } DescriptorSet DescriptorPool::allocate(const VkDescriptorSetLayout layout, const UnsignedInt variableDescriptorCount) { Containers::Pair out = allocateInternal(layout, variableDescriptorCount); CORRADE_ASSERT(out.first() == Result::Success, - "Vk::DescriptorPool::allocate(): allocation failed with" << out.first(), std::move(out.second())); - return std::move(out.second()); + "Vk::DescriptorPool::allocate(): allocation failed with" << out.first(), Utility::move(out.second())); + return Utility::move(out.second()); } Containers::Optional DescriptorPool::tryAllocate(const VkDescriptorSetLayout layout, const UnsignedInt variableDescriptorCount) { Containers::Pair out = allocateInternal(layout, variableDescriptorCount); if(out.first() != Result::Success) return {}; - return std::move(out.second()); + return Utility::move(out.second()); } void DescriptorPool::reset() { diff --git a/src/Magnum/Vk/DescriptorSet.cpp b/src/Magnum/Vk/DescriptorSet.cpp index 15de3a0de..16a325183 100644 --- a/src/Magnum/Vk/DescriptorSet.cpp +++ b/src/Magnum/Vk/DescriptorSet.cpp @@ -52,7 +52,7 @@ DescriptorSet::~DescriptorSet() { } DescriptorSet& DescriptorSet::operator=(DescriptorSet&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._pool, _pool); swap(other._handle, _handle); diff --git a/src/Magnum/Vk/DescriptorSetLayout.cpp b/src/Magnum/Vk/DescriptorSetLayout.cpp index 4c9aff8a4..e0b3b06ed 100644 --- a/src/Magnum/Vk/DescriptorSetLayout.cpp +++ b/src/Magnum/Vk/DescriptorSetLayout.cpp @@ -72,7 +72,7 @@ DescriptorSetLayoutBinding::DescriptorSetLayoutBinding(DescriptorSetLayoutBindin /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _binding(other._binding), - _data{std::move(other._data)}, + _data{Utility::move(other._data)}, _flags{other._flags} { /* Ensure the previous instance doesn't reference state that's now ours */ @@ -84,7 +84,7 @@ DescriptorSetLayoutBinding::DescriptorSetLayoutBinding(DescriptorSetLayoutBindin DescriptorSetLayoutBinding::~DescriptorSetLayoutBinding() = default; DescriptorSetLayoutBinding& DescriptorSetLayoutBinding::operator=(DescriptorSetLayoutBinding&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._binding, _binding); swap(other._data, _data); swap(other._flags, _flags); @@ -160,7 +160,7 @@ DescriptorSetLayoutCreateInfo::DescriptorSetLayoutCreateInfo(DescriptorSetLayout /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _data{std::move(other._data)} + _data{Utility::move(other._data)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -173,7 +173,7 @@ DescriptorSetLayoutCreateInfo::DescriptorSetLayoutCreateInfo(DescriptorSetLayout DescriptorSetLayoutCreateInfo::~DescriptorSetLayoutCreateInfo() = default; DescriptorSetLayoutCreateInfo& DescriptorSetLayoutCreateInfo::operator=(DescriptorSetLayoutCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._data, _data); return *this; @@ -203,7 +203,7 @@ DescriptorSetLayout::~DescriptorSetLayout() { } DescriptorSetLayout& DescriptorSetLayout::operator=(DescriptorSetLayout&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Device.cpp b/src/Magnum/Vk/Device.cpp index 7c2025175..c3afc8ed9 100644 --- a/src/Magnum/Vk/Device.cpp +++ b/src/Magnum/Vk/Device.cpp @@ -152,7 +152,7 @@ DeviceCreateInfo::DeviceCreateInfo(DeviceProperties& deviceProperties, const Ext we'll use them to filter the ones added by the app */ Containers::String disabledExtensions = args.value("disable-extensions"); if(!disabledExtensions.isEmpty()) { - _state->disabledExtensionsStorage = std::move(disabledExtensions); + _state->disabledExtensionsStorage = Utility::move(disabledExtensions); _state->disabledExtensions = Containers::StringView{_state->disabledExtensionsStorage}.splitOnWhitespaceWithoutEmptyParts(); std::sort(_state->disabledExtensions.begin(), _state->disabledExtensions.end()); } @@ -253,7 +253,7 @@ DeviceCreateInfo::DeviceCreateInfo(DeviceProperties& deviceProperties, const Ext } DeviceCreateInfo::DeviceCreateInfo(DeviceProperties&& deviceProperties, const ExtensionProperties* extensionProperties, const Flags flags): DeviceCreateInfo{deviceProperties, extensionProperties, flags} { - _state->properties = std::move(deviceProperties); + _state->properties = Utility::move(deviceProperties); } DeviceCreateInfo::DeviceCreateInfo(NoInitT) noexcept {} @@ -268,7 +268,7 @@ DeviceCreateInfo::DeviceCreateInfo(DeviceCreateInfo&& other) noexcept: /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -283,7 +283,7 @@ DeviceCreateInfo::DeviceCreateInfo(DeviceCreateInfo&& other) noexcept: DeviceCreateInfo::~DeviceCreateInfo() = default; DeviceCreateInfo& DeviceCreateInfo::operator=(DeviceCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._physicalDevice, _physicalDevice); swap(other._info, _info); swap(other._state, other._state); @@ -323,7 +323,7 @@ DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const Containers::Strin } DeviceCreateInfo&& DeviceCreateInfo::addEnabledExtensions(const Containers::StringIterable& extensions) && { - return std::move(addEnabledExtensions(extensions)); + return Utility::move(addEnabledExtensions(extensions)); } DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const Containers::ArrayView extensions) & { @@ -348,7 +348,7 @@ DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const Containers::Array } DeviceCreateInfo&& DeviceCreateInfo::addEnabledExtensions(const Containers::ArrayView extensions) && { - return std::move(addEnabledExtensions(extensions)); + return Utility::move(addEnabledExtensions(extensions)); } DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const std::initializer_list extensions) & { @@ -356,7 +356,7 @@ DeviceCreateInfo& DeviceCreateInfo::addEnabledExtensions(const std::initializer_ } DeviceCreateInfo&& DeviceCreateInfo::addEnabledExtensions(const std::initializer_list extensions) && { - return std::move(addEnabledExtensions(extensions)); + return Utility::move(addEnabledExtensions(extensions)); } namespace { @@ -564,7 +564,7 @@ DeviceCreateInfo& DeviceCreateInfo::setEnabledFeatures(const DeviceFeatures& fea } DeviceCreateInfo&& DeviceCreateInfo::setEnabledFeatures(const DeviceFeatures& features) && { - return std::move(setEnabledFeatures(features)); + return Utility::move(setEnabledFeatures(features)); } DeviceCreateInfo& DeviceCreateInfo::addQueues(const UnsignedInt family, const Containers::ArrayView priorities, const Containers::ArrayView> output) & { @@ -596,7 +596,7 @@ DeviceCreateInfo& DeviceCreateInfo::addQueues(const UnsignedInt family, const Co } DeviceCreateInfo&& DeviceCreateInfo::addQueues(const UnsignedInt family, const Containers::ArrayView priorities, const Containers::ArrayView> output) && { - return std::move(addQueues(family, priorities, output)); + return Utility::move(addQueues(family, priorities, output)); } DeviceCreateInfo& DeviceCreateInfo::addQueues(const UnsignedInt family, const std::initializer_list priorities, const std::initializer_list> output) & { @@ -604,7 +604,7 @@ DeviceCreateInfo& DeviceCreateInfo::addQueues(const UnsignedInt family, const st } DeviceCreateInfo&& DeviceCreateInfo::addQueues(const UnsignedInt family, const std::initializer_list priorities, const std::initializer_list> output) && { - return std::move(addQueues(family, priorities, output)); + return Utility::move(addQueues(family, priorities, output)); } DeviceCreateInfo& DeviceCreateInfo::addQueues(const QueueFlags flags, const Containers::ArrayView priorities, const Containers::ArrayView> output) & { @@ -612,7 +612,7 @@ DeviceCreateInfo& DeviceCreateInfo::addQueues(const QueueFlags flags, const Cont } DeviceCreateInfo&& DeviceCreateInfo::addQueues(const QueueFlags flags, const Containers::ArrayView priorities, const Containers::ArrayView> output) && { - return std::move(addQueues(flags, priorities, output)); + return Utility::move(addQueues(flags, priorities, output)); } DeviceCreateInfo& DeviceCreateInfo::addQueues(const QueueFlags flags, const std::initializer_list priorities, const std::initializer_list> output) & { @@ -620,7 +620,7 @@ DeviceCreateInfo& DeviceCreateInfo::addQueues(const QueueFlags flags, const std: } DeviceCreateInfo&& DeviceCreateInfo::addQueues(const QueueFlags flags, const std::initializer_list priorities, const std::initializer_list> output) && { - return std::move(addQueues(flags, priorities, output)); + return Utility::move(addQueues(flags, priorities, output)); } DeviceCreateInfo& DeviceCreateInfo::addQueues(const VkDeviceQueueCreateInfo& info) & { @@ -639,7 +639,7 @@ DeviceCreateInfo& DeviceCreateInfo::addQueues(const VkDeviceQueueCreateInfo& inf } DeviceCreateInfo&& DeviceCreateInfo::addQueues(const VkDeviceQueueCreateInfo& info) && { - return std::move(addQueues(info)); + return Utility::move(addQueues(info)); } namespace { @@ -674,7 +674,7 @@ Device::Device(Instance& instance, const DeviceCreateInfo& info): Device{NoCreat } Device::Device(Instance& instance, DeviceCreateInfo&& info): Device{NoCreate} { - create(instance, std::move(info)); + create(instance, Utility::move(info)); } Device::Device(NoCreateT): _handle{}, _functionPointers{} {} @@ -689,7 +689,7 @@ void Device::create(Instance& instance, const DeviceCreateInfo& info) { } void Device::create(Instance& instance, DeviceCreateInfo&& info) { - if(tryCreate(instance, std::move(info)) != Result::Success) std::exit(1); + if(tryCreate(instance, Utility::move(info)) != Result::Success) std::exit(1); } Result Device::tryCreate(Instance& instance, const DeviceCreateInfo& info) { @@ -697,7 +697,7 @@ Result Device::tryCreate(Instance& instance, const DeviceCreateInfo& info) { } Result Device::tryCreate(Instance& instance, DeviceCreateInfo&& info) { - return tryCreateInternal(instance, info, std::move(info._state->properties)); + return tryCreateInternal(instance, info, Utility::move(info._state->properties)); } Result Device::tryCreateInternal(Instance& instance, const DeviceCreateInfo& info, DeviceProperties&& properties) { @@ -707,7 +707,7 @@ Result Device::tryCreateInternal(Instance& instance, const DeviceCreateInfo& inf "Vk::Device::tryCreate(): needs at least one queue", {}); _flags = HandleFlag::DestroyOnDestruction; - _properties.emplace(std::move(properties)); + _properties.emplace(Utility::move(properties)); /* The properties should always be a valid instance, either moved from outside or created again from VkPhysicalDevice, in case it couldn't be diff --git a/src/Magnum/Vk/DeviceCreateInfo.h b/src/Magnum/Vk/DeviceCreateInfo.h index 0df36ad42..c50b3f3cd 100644 --- a/src/Magnum/Vk/DeviceCreateInfo.h +++ b/src/Magnum/Vk/DeviceCreateInfo.h @@ -123,7 +123,7 @@ class MAGNUM_VK_EXPORT DeviceCreateInfo { explicit DeviceCreateInfo(DeviceProperties&& deviceProperties, const ExtensionProperties* extensionProperties, Flags flags = {}); /** @overload */ - explicit DeviceCreateInfo(DeviceProperties&& deviceProperties, Flags flags = {}): DeviceCreateInfo{std::move(deviceProperties), nullptr, flags} {} + explicit DeviceCreateInfo(DeviceProperties&& deviceProperties, Flags flags = {}): DeviceCreateInfo{Utility::move(deviceProperties), nullptr, flags} {} /** * @brief Construct without initializing the contents @@ -209,7 +209,7 @@ class MAGNUM_VK_EXPORT DeviceCreateInfo { /** @overload */ template DeviceCreateInfo&& addEnabledExtensions() && { addEnabledExtensions(); - return std::move(*this); + return Utility::move(*this); } /** diff --git a/src/Magnum/Vk/DeviceProperties.cpp b/src/Magnum/Vk/DeviceProperties.cpp index bdef5ea64..8f6c84da7 100644 --- a/src/Magnum/Vk/DeviceProperties.cpp +++ b/src/Magnum/Vk/DeviceProperties.cpp @@ -606,7 +606,7 @@ Containers::Optional tryPickDevice(Instance& instance) { return {}; } - return std::move(devices.front()); + return Utility::move(devices.front()); } /* Pick by ID */ @@ -619,7 +619,7 @@ Containers::Optional tryPickDevice(Instance& instance) { return {}; } - return std::move(devices[id]); + return Utility::move(devices[id]); } Containers::Array devices = enumerateDevices(instance); @@ -640,7 +640,7 @@ Containers::Optional tryPickDevice(Instance& instance) { } for(DeviceProperties& device: devices) - if(device.type() == type) return std::move(device); + if(device.type() == type) return Utility::move(device); Error{} << "Vk::tryPickDevice(): no" << type << "found among" << devices.size() << "Vulkan devices"; return {}; @@ -648,7 +648,7 @@ Containers::Optional tryPickDevice(Instance& instance) { DeviceProperties pickDevice(Instance& instance) { Containers::Optional device = tryPickDevice(instance); - if(device) return *std::move(device); + if(device) return *Utility::move(device); std::exit(1); /* LCOV_EXCL_LINE */ } diff --git a/src/Magnum/Vk/Fence.cpp b/src/Magnum/Vk/Fence.cpp index b77def3d2..14eac3fdd 100644 --- a/src/Magnum/Vk/Fence.cpp +++ b/src/Magnum/Vk/Fence.cpp @@ -70,7 +70,7 @@ Fence::~Fence() { } Fence& Fence::operator=(Fence&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Framebuffer.cpp b/src/Magnum/Vk/Framebuffer.cpp index 26e4cda20..f0e25ab7c 100644 --- a/src/Magnum/Vk/Framebuffer.cpp +++ b/src/Magnum/Vk/Framebuffer.cpp @@ -76,7 +76,7 @@ FramebufferCreateInfo::FramebufferCreateInfo(FramebufferCreateInfo&& other) noex /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ other._info.attachmentCount = 0; @@ -86,7 +86,7 @@ FramebufferCreateInfo::FramebufferCreateInfo(FramebufferCreateInfo&& other) noex FramebufferCreateInfo::~FramebufferCreateInfo() = default; FramebufferCreateInfo& FramebufferCreateInfo::operator=(FramebufferCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._state, _state); return *this; @@ -129,7 +129,7 @@ Framebuffer::~Framebuffer() { } Framebuffer& Framebuffer::operator=(Framebuffer&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Image.cpp b/src/Magnum/Vk/Image.cpp index 223efcf88..7b3e507f1 100644 --- a/src/Magnum/Vk/Image.cpp +++ b/src/Magnum/Vk/Image.cpp @@ -150,7 +150,7 @@ Image::Image(Device& device, const ImageCreateInfo& info, const MemoryFlags memo Image::Image(NoCreateT): _device{}, _handle{}, _format{}, _dedicatedMemory{NoCreate} {} -Image::Image(Image&& other) noexcept: _device{other._device}, _handle{other._handle}, _flags{other._flags}, _format{other._format}, _dedicatedMemory{std::move(other._dedicatedMemory)} { +Image::Image(Image&& other) noexcept: _device{other._device}, _handle{other._handle}, _flags{other._flags}, _format{other._format}, _dedicatedMemory{Utility::move(other._dedicatedMemory)} { other._handle = {}; } @@ -160,7 +160,7 @@ Image::~Image() { } Image& Image::operator=(Image&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); @@ -189,7 +189,7 @@ void Image::bindMemory(Memory& memory, const UnsignedLong offset) { void Image::bindDedicatedMemory(Memory&& memory) { bindMemory(memory, 0); - _dedicatedMemory = std::move(memory); + _dedicatedMemory = Utility::move(memory); } bool Image::hasDedicatedMemory() const { diff --git a/src/Magnum/Vk/ImageView.cpp b/src/Magnum/Vk/ImageView.cpp index 3943c0c9f..e26fc140f 100644 --- a/src/Magnum/Vk/ImageView.cpp +++ b/src/Magnum/Vk/ImageView.cpp @@ -88,7 +88,7 @@ ImageView::~ImageView() { } ImageView& ImageView::operator=(ImageView&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Instance.cpp b/src/Magnum/Vk/Instance.cpp index 6664bd16d..0a25245b1 100644 --- a/src/Magnum/Vk/Instance.cpp +++ b/src/Magnum/Vk/Instance.cpp @@ -104,14 +104,14 @@ InstanceCreateInfo::InstanceCreateInfo(const Int argc, const char* const* const if(!disabledLayers.isEmpty()) { if(!_state) _state.emplace(); - _state->disabledLayersStorage = std::move(disabledLayers); + _state->disabledLayersStorage = Utility::move(disabledLayers); _state->disabledLayers = Containers::StringView{_state->disabledLayersStorage}.splitOnWhitespaceWithoutEmptyParts(); std::sort(_state->disabledLayers.begin(), _state->disabledLayers.end()); } if(!disabledExtensions.isEmpty()) { if(!_state) _state.emplace(); - _state->disabledExtensionsStorage = std::move(disabledExtensions); + _state->disabledExtensionsStorage = Utility::move(disabledExtensions); _state->disabledExtensions = Containers::StringView{_state->disabledExtensionsStorage}.splitOnWhitespaceWithoutEmptyParts(); std::sort(_state->disabledExtensions.begin(), _state->disabledExtensions.end()); } diff --git a/src/Magnum/Vk/Memory.cpp b/src/Magnum/Vk/Memory.cpp index 0c786f2b2..656d89322 100644 --- a/src/Magnum/Vk/Memory.cpp +++ b/src/Magnum/Vk/Memory.cpp @@ -91,7 +91,7 @@ Memory::~Memory() { } Memory& Memory::operator=(Memory&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Mesh.cpp b/src/Magnum/Vk/Mesh.cpp index a800ebc01..f72127a07 100644 --- a/src/Magnum/Vk/Mesh.cpp +++ b/src/Magnum/Vk/Mesh.cpp @@ -88,7 +88,7 @@ struct Mesh::State { Mesh::Mesh(const MeshLayout& layout): Mesh{MeshLayout{layout.vkPipelineVertexInputStateCreateInfo(), layout.vkPipelineInputAssemblyStateCreateInfo()}} {} -Mesh::Mesh(MeshLayout&& layout): _layout{std::move(layout)} { +Mesh::Mesh(MeshLayout&& layout): _layout{Utility::move(layout)} { /* Since we know the count of buffer bindings, we can directly allocate all needed memory upfront */ if(const UnsignedInt count = _layout.vkPipelineVertexInputStateCreateInfo().vertexBindingDescriptionCount) { @@ -144,7 +144,7 @@ Mesh& Mesh::addVertexBuffer(const UnsignedInt binding, Buffer&& buffer, const Un #ifdef CORRADE_GRACEFUL_ASSERT if(index == ~std::size_t{}) return *this; #endif - _state->ownedVertexBuffers[index] = std::move(buffer); + _state->ownedVertexBuffers[index] = Utility::move(buffer); return *this; } @@ -165,12 +165,12 @@ Mesh& Mesh::setIndexBuffer(const VkBuffer buffer, const UnsignedLong offset, con Mesh& Mesh::setIndexBuffer(Buffer&& buffer, const UnsignedLong offset, const MeshIndexType indexType) { setIndexBuffer(buffer, offset, indexType); - _state->ownedIndexBuffer = std::move(buffer); + _state->ownedIndexBuffer = Utility::move(buffer); return *this; } Mesh& Mesh::setIndexBuffer(Buffer&& buffer, const UnsignedLong offset, const Magnum::MeshIndexType indexType) { - return setIndexBuffer(std::move(buffer), offset, meshIndexType(indexType)); + return setIndexBuffer(Utility::move(buffer), offset, meshIndexType(indexType)); } Containers::ArrayView Mesh::vertexBuffers() { diff --git a/src/Magnum/Vk/MeshLayout.cpp b/src/Magnum/Vk/MeshLayout.cpp index 077bb6730..6c9403c2b 100644 --- a/src/Magnum/Vk/MeshLayout.cpp +++ b/src/Magnum/Vk/MeshLayout.cpp @@ -100,7 +100,7 @@ MeshLayout::MeshLayout(MeshLayout&& other) noexcept: member instead of doing a copy */ _vertexInfo(other._vertexInfo), _assemblyInfo(other._assemblyInfo), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -116,7 +116,7 @@ MeshLayout::MeshLayout(MeshLayout&& other) noexcept: MeshLayout::~MeshLayout() = default; MeshLayout& MeshLayout::operator=(MeshLayout&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._vertexInfo, _vertexInfo); swap(other._assemblyInfo, _assemblyInfo); swap(other._state, _state); @@ -192,7 +192,7 @@ MeshLayout& MeshLayout::addBinding(const UnsignedInt binding, const UnsignedInt } MeshLayout&& MeshLayout::addBinding(const UnsignedInt binding, const UnsignedInt stride) && { - return std::move(addBinding(binding, stride)); + return Utility::move(addBinding(binding, stride)); } MeshLayout& MeshLayout::addInstancedBinding(const UnsignedInt binding, const UnsignedInt stride, const UnsignedInt divisor) & { @@ -227,7 +227,7 @@ MeshLayout& MeshLayout::addInstancedBinding(const UnsignedInt binding, const Uns } MeshLayout&& MeshLayout::addInstancedBinding(const UnsignedInt binding, const UnsignedInt stride, const UnsignedInt divisor) && { - return std::move(addInstancedBinding(binding, stride, divisor)); + return Utility::move(addInstancedBinding(binding, stride, divisor)); } MeshLayout& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedInt binding, const VertexFormat format, const UnsignedInt offset) & { @@ -250,7 +250,7 @@ MeshLayout& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedI } MeshLayout&& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedInt binding, const VertexFormat format, const UnsignedInt offset) && { - return std::move(addAttribute(location, binding, format, offset)); + return Utility::move(addAttribute(location, binding, format, offset)); } MeshLayout& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedInt binding, const Magnum::VertexFormat format, const UnsignedInt offset) & { @@ -258,7 +258,7 @@ MeshLayout& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedI } MeshLayout&& MeshLayout::addAttribute(const UnsignedInt location, const UnsignedInt binding, const Magnum::VertexFormat format, const UnsignedInt offset) && { - return std::move(addAttribute(location, binding, format, offset)); + return Utility::move(addAttribute(location, binding, format, offset)); } Debug& operator<<(Debug& debug, const MeshPrimitive value) { diff --git a/src/Magnum/Vk/Pipeline.cpp b/src/Magnum/Vk/Pipeline.cpp index 7105bdd0b..485d8d5ae 100644 --- a/src/Magnum/Vk/Pipeline.cpp +++ b/src/Magnum/Vk/Pipeline.cpp @@ -134,7 +134,7 @@ RasterizationPipelineCreateInfo::RasterizationPipelineCreateInfo(RasterizationPi _depthStencilInfo(other._depthStencilInfo), _colorBlendInfo(other._colorBlendInfo), _dynamicInfo(other._dynamicInfo), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Reroute the pointers */ if(_info.pViewportState == &other._viewportInfo) @@ -170,7 +170,7 @@ RasterizationPipelineCreateInfo::RasterizationPipelineCreateInfo(RasterizationPi RasterizationPipelineCreateInfo::~RasterizationPipelineCreateInfo() = default; RasterizationPipelineCreateInfo& RasterizationPipelineCreateInfo::operator=(RasterizationPipelineCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._viewportInfo, _viewportInfo); swap(other._rasterizationInfo, _rasterizationInfo); @@ -338,7 +338,7 @@ Pipeline::~Pipeline() { } Pipeline& Pipeline::operator=(Pipeline&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._bindPoint, _bindPoint); diff --git a/src/Magnum/Vk/PipelineLayout.cpp b/src/Magnum/Vk/PipelineLayout.cpp index c34c58aad..3dfbab30f 100644 --- a/src/Magnum/Vk/PipelineLayout.cpp +++ b/src/Magnum/Vk/PipelineLayout.cpp @@ -63,7 +63,7 @@ PipelineLayoutCreateInfo::PipelineLayoutCreateInfo(PipelineLayoutCreateInfo&& ot /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _data{std::move(other._data)} + _data{Utility::move(other._data)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -78,7 +78,7 @@ PipelineLayoutCreateInfo::PipelineLayoutCreateInfo(PipelineLayoutCreateInfo&& ot PipelineLayoutCreateInfo::~PipelineLayoutCreateInfo() = default; PipelineLayoutCreateInfo& PipelineLayoutCreateInfo::operator=(PipelineLayoutCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._data, _data); return *this; @@ -108,7 +108,7 @@ PipelineLayout::~PipelineLayout() { } PipelineLayout& PipelineLayout::operator=(PipelineLayout&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Queue.cpp b/src/Magnum/Vk/Queue.cpp index 96dfd6148..64491f0ed 100644 --- a/src/Magnum/Vk/Queue.cpp +++ b/src/Magnum/Vk/Queue.cpp @@ -51,7 +51,7 @@ Queue::Queue(Queue&& other) noexcept: _device{other._device}, _handle{other._han Queue::~Queue() = default; Queue& Queue::operator=(Queue&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); return *this; @@ -113,7 +113,7 @@ SubmitInfo::SubmitInfo(SubmitInfo&& other) noexcept: /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -131,7 +131,7 @@ SubmitInfo::SubmitInfo(SubmitInfo&& other) noexcept: SubmitInfo::~SubmitInfo() = default; SubmitInfo& SubmitInfo::operator=(SubmitInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._state, _state); return *this; diff --git a/src/Magnum/Vk/RenderPass.cpp b/src/Magnum/Vk/RenderPass.cpp index a074d909a..7c3f56b83 100644 --- a/src/Magnum/Vk/RenderPass.cpp +++ b/src/Magnum/Vk/RenderPass.cpp @@ -213,7 +213,7 @@ SubpassDescription::SubpassDescription(SubpassDescription&& other) noexcept: /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _description(other._description), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -230,7 +230,7 @@ SubpassDescription::SubpassDescription(SubpassDescription&& other) noexcept: } SubpassDescription& SubpassDescription::operator=(SubpassDescription&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._description, _description); swap(other._state, _state); return *this; @@ -267,7 +267,7 @@ SubpassDescription& SubpassDescription::setInputAttachments(Containers::ArrayVie } SubpassDescription&& SubpassDescription::setInputAttachments(Containers::ArrayView attachments) && { - return std::move(setInputAttachments(attachments)); + return Utility::move(setInputAttachments(attachments)); } SubpassDescription& SubpassDescription::setInputAttachments(std::initializer_list attachments) & { @@ -275,7 +275,7 @@ SubpassDescription& SubpassDescription::setInputAttachments(std::initializer_lis } SubpassDescription&& SubpassDescription::setInputAttachments(std::initializer_list attachments) && { - return std::move(setInputAttachments(attachments)); + return Utility::move(setInputAttachments(attachments)); } template void SubpassDescription::setColorAttachmentsInternal(Containers::ArrayView attachments, Containers::ArrayView resolveAttachments) { @@ -325,7 +325,7 @@ SubpassDescription& SubpassDescription::setColorAttachments(Containers::ArrayVie } SubpassDescription&& SubpassDescription::setColorAttachments(Containers::ArrayView attachments, Containers::ArrayView resolveAttachments) && { - return std::move(setColorAttachments(attachments, resolveAttachments)); + return Utility::move(setColorAttachments(attachments, resolveAttachments)); } SubpassDescription& SubpassDescription::setColorAttachments(Containers::ArrayView attachments) & { @@ -333,7 +333,7 @@ SubpassDescription& SubpassDescription::setColorAttachments(Containers::ArrayVie } SubpassDescription&& SubpassDescription::setColorAttachments(Containers::ArrayView attachments) && { - return std::move(setColorAttachments(attachments)); + return Utility::move(setColorAttachments(attachments)); } SubpassDescription& SubpassDescription::setColorAttachments(std::initializer_list attachments, std::initializer_list resolveAttachments) & { @@ -341,7 +341,7 @@ SubpassDescription& SubpassDescription::setColorAttachments(std::initializer_lis } SubpassDescription&& SubpassDescription::setColorAttachments(std::initializer_list attachments, std::initializer_list resolveAttachments) && { - return std::move(setColorAttachments(attachments, resolveAttachments)); + return Utility::move(setColorAttachments(attachments, resolveAttachments)); } SubpassDescription& SubpassDescription::setDepthStencilAttachment(AttachmentReference attachment) & { @@ -354,30 +354,30 @@ SubpassDescription& SubpassDescription::setDepthStencilAttachment(AttachmentRefe } SubpassDescription&& SubpassDescription::setDepthStencilAttachment(AttachmentReference attachment) && { - return std::move(setDepthStencilAttachment(attachment)); + return Utility::move(setDepthStencilAttachment(attachment)); } SubpassDescription& SubpassDescription::setPreserveAttachments(Containers::Array&& attachments) & { if(!_state) _state.emplace(); - _state->preserveAttachments = std::move(attachments); + _state->preserveAttachments = Utility::move(attachments); _description.preserveAttachmentCount = _state->preserveAttachments.size(); _description.pPreserveAttachments = _state->preserveAttachments; return *this; } SubpassDescription&& SubpassDescription::setPreserveAttachments(Containers::Array&& attachments) && { - return std::move(setPreserveAttachments(std::move(attachments))); + return Utility::move(setPreserveAttachments(Utility::move(attachments))); } SubpassDescription& SubpassDescription::setPreserveAttachments(Containers::ArrayView attachments) & { Containers::Array copy{NoInit, attachments.size()}; Utility::copy(attachments, copy); - return setPreserveAttachments(std::move(copy)); + return setPreserveAttachments(Utility::move(copy)); } SubpassDescription&& SubpassDescription::setPreserveAttachments(Containers::ArrayView attachments) && { - return std::move(setPreserveAttachments(attachments)); + return Utility::move(setPreserveAttachments(attachments)); } SubpassDescription& SubpassDescription::setPreserveAttachments(std::initializer_list attachments) & { @@ -385,7 +385,7 @@ SubpassDescription& SubpassDescription::setPreserveAttachments(std::initializer_ } SubpassDescription&& SubpassDescription::setPreserveAttachments(std::initializer_list attachments) && { - return std::move(setPreserveAttachments(attachments)); + return Utility::move(setPreserveAttachments(attachments)); } namespace { @@ -568,7 +568,7 @@ RenderPassCreateInfo::RenderPassCreateInfo(RenderPassCreateInfo&& other) noexcep /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -587,7 +587,7 @@ RenderPassCreateInfo::RenderPassCreateInfo(RenderPassCreateInfo&& other) noexcep RenderPassCreateInfo::~RenderPassCreateInfo() = default; RenderPassCreateInfo& RenderPassCreateInfo::operator=(RenderPassCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._state, _state); return *this; @@ -633,7 +633,7 @@ RenderPassCreateInfo& RenderPassCreateInfo::addSubpass(SubpassDescription&& subp /* Unfortunately here we can't use an ArrayTuple as it can't grow, and accepting an array view / initializer list would mean a deep copy, which is even less acceptable. So two separate allocations it is. */ - arrayAppend(_state->subpasses, std::move(subpass)); + arrayAppend(_state->subpasses, Utility::move(subpass)); /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ arrayAppend(_state->vkSubpasses2, VkSubpassDescription2(_state->subpasses.back())); @@ -791,7 +791,7 @@ RenderPass::~RenderPass() { } RenderPass& RenderPass::operator=(RenderPass&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); @@ -843,7 +843,7 @@ RenderPassBeginInfo::RenderPassBeginInfo(RenderPassBeginInfo&& other) noexcept: /* Can't use {} with GCC 4.8 here because it tries to initialize the first member instead of doing a copy */ _info(other._info), - _state{std::move(other._state)} + _state{Utility::move(other._state)} { /* Ensure the previous instance doesn't reference state that's now ours */ /** @todo this is now more like a destructible move, do it more selectively @@ -856,7 +856,7 @@ RenderPassBeginInfo::RenderPassBeginInfo(RenderPassBeginInfo&& other) noexcept: RenderPassBeginInfo::~RenderPassBeginInfo() = default; RenderPassBeginInfo& RenderPassBeginInfo::operator=(RenderPassBeginInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._state, _state); return *this; diff --git a/src/Magnum/Vk/Sampler.cpp b/src/Magnum/Vk/Sampler.cpp index 9b409b6b7..fba1449cc 100644 --- a/src/Magnum/Vk/Sampler.cpp +++ b/src/Magnum/Vk/Sampler.cpp @@ -226,7 +226,7 @@ Sampler::~Sampler() { } Sampler& Sampler::operator=(Sampler&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/Shader.cpp b/src/Magnum/Vk/Shader.cpp index ae30e59b1..b11fe9106 100644 --- a/src/Magnum/Vk/Shader.cpp +++ b/src/Magnum/Vk/Shader.cpp @@ -74,7 +74,7 @@ ShaderCreateInfo::~ShaderCreateInfo() { } ShaderCreateInfo& ShaderCreateInfo::operator=(ShaderCreateInfo&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._info, _info); swap(other._originalDeleter, _originalDeleter); swap(other._deleter, _deleter); @@ -105,7 +105,7 @@ Shader::~Shader() { } Shader& Shader::operator=(Shader&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._device, _device); swap(other._handle, _handle); swap(other._flags, _flags); diff --git a/src/Magnum/Vk/ShaderSet.cpp b/src/Magnum/Vk/ShaderSet.cpp index 5509a7814..56a0c0b03 100644 --- a/src/Magnum/Vk/ShaderSet.cpp +++ b/src/Magnum/Vk/ShaderSet.cpp @@ -43,7 +43,7 @@ struct ShaderSet::State { ShaderSet::ShaderSet(): _stages{}, _specializations{}, _stageCount{} {} -ShaderSet::ShaderSet(ShaderSet&& other) noexcept: _stageCount{other._stageCount}, _state{std::move(other._state)} { +ShaderSet::ShaderSet(ShaderSet&& other) noexcept: _stageCount{other._stageCount}, _state{Utility::move(other._state)} { /* C++, WHY THE FUCK can't you copy C arrays, why do I have to do that for you?! */ Utility::copy(other._stages, _stages); @@ -66,7 +66,7 @@ ShaderSet::ShaderSet(ShaderSet&& other) noexcept: _stageCount{other._stageCount} ShaderSet::~ShaderSet() = default; ShaderSet& ShaderSet::operator=(ShaderSet&& other) noexcept { - using std::swap; + using Utility::swap; swap(other._stages, _stages); swap(other._specializations, _specializations); swap(other._stageCount, _stageCount); @@ -160,11 +160,11 @@ ShaderSet& ShaderSet::addShader(const ShaderStage stage, const VkShaderModule sh ShaderSet& ShaderSet::addShader(const ShaderStage stage, Shader&& shader, const Containers::StringView entrypoint, const Containers::ArrayView specializations) { if(!_state) _state.emplace(); - return addShader(stage, arrayAppend(_state->ownedShaders, std::move(shader)), entrypoint, specializations); + return addShader(stage, arrayAppend(_state->ownedShaders, Utility::move(shader)), entrypoint, specializations); } ShaderSet& ShaderSet::addShader(const ShaderStage stage, Shader&& shader, const Containers::StringView entrypoint, const std::initializer_list specializations) { - return addShader(stage, std::move(shader), entrypoint, Containers::arrayView(specializations)); + return addShader(stage, Utility::move(shader), entrypoint, Containers::arrayView(specializations)); } Containers::ArrayView ShaderSet::stages() { diff --git a/src/Magnum/Vk/Test/BufferVkTest.cpp b/src/Magnum/Vk/Test/BufferVkTest.cpp index 661c7a224..be95eab42 100644 --- a/src/Magnum/Vk/Test/BufferVkTest.cpp +++ b/src/Magnum/Vk/Test/BufferVkTest.cpp @@ -101,7 +101,7 @@ void BufferVkTest::constructMove() { VkBuffer handle = a.handle(); VkDeviceMemory memoryHandle = a.dedicatedMemory().handle(); - Buffer b = std::move(a); + Buffer b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_VERIFY(!a.hasDedicatedMemory()); CORRADE_COMPARE(b.handle(), handle); @@ -110,7 +110,7 @@ void BufferVkTest::constructMove() { CORRADE_COMPARE(b.dedicatedMemory().handle(), memoryHandle); Buffer c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_VERIFY(!b.hasDedicatedMemory()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); @@ -174,7 +174,7 @@ void BufferVkTest::bindDedicatedMemory() { VkDeviceMemory handle = memory.handle(); CORRADE_VERIFY(handle); - buffer.bindDedicatedMemory(std::move(memory)); + buffer.bindDedicatedMemory(Utility::move(memory)); CORRADE_VERIFY(buffer.hasDedicatedMemory()); CORRADE_COMPARE(buffer.dedicatedMemory().handle(), handle); } diff --git a/src/Magnum/Vk/Test/CommandBufferVkTest.cpp b/src/Magnum/Vk/Test/CommandBufferVkTest.cpp index 78d320239..2998c8895 100644 --- a/src/Magnum/Vk/Test/CommandBufferVkTest.cpp +++ b/src/Magnum/Vk/Test/CommandBufferVkTest.cpp @@ -75,13 +75,13 @@ void CommandBufferVkTest::constructMove() { CommandBuffer a = pool.allocate(); VkCommandBuffer handle = a.handle(); - CommandBuffer b = std::move(a); + CommandBuffer b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); CommandBuffer c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/CommandPoolVkTest.cpp b/src/Magnum/Vk/Test/CommandPoolVkTest.cpp index 1fa976b55..b008297c9 100644 --- a/src/Magnum/Vk/Test/CommandPoolVkTest.cpp +++ b/src/Magnum/Vk/Test/CommandPoolVkTest.cpp @@ -71,13 +71,13 @@ void CommandPoolVkTest::constructMove() { CommandPoolCreateInfo::Flag::Transient}}; VkCommandPool handle = a.handle(); - CommandPool b = std::move(a); + CommandPool b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); CommandPool c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/DescriptorPoolTest.cpp b/src/Magnum/Vk/Test/DescriptorPoolTest.cpp index b8c74efc3..03abad6b5 100644 --- a/src/Magnum/Vk/Test/DescriptorPoolTest.cpp +++ b/src/Magnum/Vk/Test/DescriptorPoolTest.cpp @@ -141,7 +141,7 @@ void DescriptorPoolTest::createInfoConstructMove() { CORRADE_COMPARE(a->poolSizeCount, 2); CORRADE_VERIFY(a->pPoolSizes); - DescriptorPoolCreateInfo b = std::move(a); + DescriptorPoolCreateInfo b = Utility::move(a); CORRADE_COMPARE(a->poolSizeCount, 0); CORRADE_VERIFY(!a->pPoolSizes); CORRADE_COMPARE(b->poolSizeCount, 2); @@ -149,7 +149,7 @@ void DescriptorPoolTest::createInfoConstructMove() { CORRADE_COMPARE(b->pPoolSizes[1].type, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER); DescriptorPoolCreateInfo c{VkDescriptorPoolCreateInfo{}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->poolSizeCount, 0); CORRADE_VERIFY(!b->pPoolSizes); CORRADE_COMPARE(c->poolSizeCount, 2); diff --git a/src/Magnum/Vk/Test/DescriptorPoolVkTest.cpp b/src/Magnum/Vk/Test/DescriptorPoolVkTest.cpp index 0f3e9f71c..720ca16e3 100644 --- a/src/Magnum/Vk/Test/DescriptorPoolVkTest.cpp +++ b/src/Magnum/Vk/Test/DescriptorPoolVkTest.cpp @@ -92,7 +92,7 @@ void DescriptorPoolVkTest::setupVariableDescriptorCount() { /* Create the device only if not already, to avoid spamming the output */ if(!_deviceVariableDescriptorCount.handle()) _deviceVariableDescriptorCount.create(instance(), - DeviceCreateInfo{std::move(properties)} + DeviceCreateInfo{Utility::move(properties)} .addQueues(QueueFlag::Graphics, {0.0f}, {_queue}) .addEnabledExtensions< /* Dependency of EXT_descriptor_indexing if 1.1 isn't @@ -129,13 +129,13 @@ void DescriptorPoolVkTest::constructMove() { }}}; VkDescriptorPool handle = a.handle(); - DescriptorPool b = std::move(a); + DescriptorPool b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); DescriptorPool c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/DescriptorSetLayoutTest.cpp b/src/Magnum/Vk/Test/DescriptorSetLayoutTest.cpp index 51cd9c0d7..6aaa08cac 100644 --- a/src/Magnum/Vk/Test/DescriptorSetLayoutTest.cpp +++ b/src/Magnum/Vk/Test/DescriptorSetLayoutTest.cpp @@ -160,7 +160,7 @@ void DescriptorSetLayoutTest::bindingConstructMove() { CORRADE_VERIFY(a->pImmutableSamplers); CORRADE_COMPARE(a->pImmutableSamplers[1], reinterpret_cast(reinterpret_cast(0xbeef))); - DescriptorSetLayoutBinding b = std::move(a); + DescriptorSetLayoutBinding b = Utility::move(a); CORRADE_VERIFY(!a->pImmutableSamplers); CORRADE_COMPARE(b->descriptorCount, 3); CORRADE_VERIFY(b->pImmutableSamplers); @@ -168,7 +168,7 @@ void DescriptorSetLayoutTest::bindingConstructMove() { CORRADE_COMPARE(b.flags(), VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT); DescriptorSetLayoutBinding c{3, {}}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b->pImmutableSamplers); CORRADE_COMPARE(c->descriptorCount, 3); CORRADE_VERIFY(c->pImmutableSamplers); @@ -286,7 +286,7 @@ void DescriptorSetLayoutTest::createInfoConstructMove() { CORRADE_VERIFY(a->pBindings); CORRADE_VERIFY(a->pNext); - DescriptorSetLayoutCreateInfo b = std::move(a); + DescriptorSetLayoutCreateInfo b = Utility::move(a); CORRADE_COMPARE(a->bindingCount, 0); CORRADE_VERIFY(!a->pBindings); CORRADE_VERIFY(!a->pNext); @@ -297,7 +297,7 @@ void DescriptorSetLayoutTest::createInfoConstructMove() { CORRADE_COMPARE(static_cast(b->pNext)->pBindingFlags[1], VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT); DescriptorSetLayoutCreateInfo c{VkDescriptorSetLayoutCreateInfo{}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->bindingCount, 0); CORRADE_VERIFY(!b->pBindings); CORRADE_VERIFY(!b->pNext); diff --git a/src/Magnum/Vk/Test/DescriptorSetLayoutVkTest.cpp b/src/Magnum/Vk/Test/DescriptorSetLayoutVkTest.cpp index f522c5f4b..ae96868ef 100644 --- a/src/Magnum/Vk/Test/DescriptorSetLayoutVkTest.cpp +++ b/src/Magnum/Vk/Test/DescriptorSetLayoutVkTest.cpp @@ -97,13 +97,13 @@ void DescriptorSetLayoutVkTest::constructMove() { }}; VkDescriptorSetLayout handle = a.handle(); - DescriptorSetLayout b = std::move(a); + DescriptorSetLayout b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); DescriptorSetLayout c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/DescriptorSetVkTest.cpp b/src/Magnum/Vk/Test/DescriptorSetVkTest.cpp index a8463299e..eda23d522 100644 --- a/src/Magnum/Vk/Test/DescriptorSetVkTest.cpp +++ b/src/Magnum/Vk/Test/DescriptorSetVkTest.cpp @@ -60,13 +60,13 @@ void DescriptorSetVkTest::constructMove() { DescriptorSet a = pool.allocate(layout); VkDescriptorSet handle = a.handle(); - DescriptorSet b = std::move(a); + DescriptorSet b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); DescriptorSet c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp index 2d0d225b0..502f51cbd 100644 --- a/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/DevicePropertiesVkTest.cpp @@ -181,12 +181,12 @@ void DevicePropertiesVkTest::constructMove() { VkPhysicalDevice handle = devices[0].handle(); Containers::StringView name = devices[0].name(); - DeviceProperties a = std::move(devices[0]); + DeviceProperties a = Utility::move(devices[0]); CORRADE_COMPARE(a.handle(), handle); CORRADE_COMPARE(a.name(), name); DeviceProperties b = DeviceProperties::wrap(instance(), nullptr); - b = std::move(a); + b = Utility::move(a); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.name(), name); @@ -374,11 +374,11 @@ void DevicePropertiesVkTest::extensionConstructMove() { const UnsignedInt count = a.count(); if(!count) CORRADE_SKIP("No extensions reported, can't test"); - ExtensionProperties b = std::move(a); + ExtensionProperties b = Utility::move(a); CORRADE_COMPARE(b.count(), count); ExtensionProperties c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.count(), count); CORRADE_VERIFY(std::is_nothrow_move_constructible::value); diff --git a/src/Magnum/Vk/Test/DeviceVkTest.cpp b/src/Magnum/Vk/Test/DeviceVkTest.cpp index e1251a0c1..a6f9dc63d 100644 --- a/src/Magnum/Vk/Test/DeviceVkTest.cpp +++ b/src/Magnum/Vk/Test/DeviceVkTest.cpp @@ -522,7 +522,7 @@ void DeviceVkTest::createInfoConstructMove() { .addEnabledExtensions(); - DeviceCreateInfo b{std::move(a)}; + DeviceCreateInfo b{Utility::move(a)}; CORRADE_COMPARE(a->enabledExtensionCount, 0); CORRADE_VERIFY(!a->ppEnabledExtensionNames); CORRADE_COMPARE(a->queueCreateInfoCount, 0); @@ -535,7 +535,7 @@ void DeviceVkTest::createInfoConstructMove() { CORRADE_COMPARE(b->pQueueCreateInfos[0].pQueuePriorities[0], 0.35f); DeviceCreateInfo c{{}, {}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->enabledExtensionCount, 0); CORRADE_VERIFY(!b->ppEnabledExtensionNames); CORRADE_COMPARE(b->queueCreateInfoCount, 0); @@ -730,7 +730,7 @@ void DeviceVkTest::constructTransferDeviceProperties() { DeviceProperties deviceProperties = pickDevice(instance()); const void* vkProperties = &deviceProperties.properties(); Queue queue{NoCreate}; - Device device{instance(), DeviceCreateInfo{std::move(deviceProperties)} + Device device{instance(), DeviceCreateInfo{Utility::move(deviceProperties)} .addQueues(0, {0.0f}, {queue}) }; diff --git a/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp b/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp index c9772bf4f..468f2dfe1 100644 --- a/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/ExtensionPropertiesVkTest.cpp @@ -75,11 +75,11 @@ void ExtensionPropertiesVkTest::constructMove() { const UnsignedInt count = a.count(); if(!count) CORRADE_SKIP("No extensions reported, can't test"); - InstanceExtensionProperties b = std::move(a); + InstanceExtensionProperties b = Utility::move(a); CORRADE_COMPARE(b.count(), count); InstanceExtensionProperties c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.count(), count); CORRADE_VERIFY(std::is_nothrow_move_constructible::value); diff --git a/src/Magnum/Vk/Test/FenceVkTest.cpp b/src/Magnum/Vk/Test/FenceVkTest.cpp index f6e7d02a9..0fcbec98c 100644 --- a/src/Magnum/Vk/Test/FenceVkTest.cpp +++ b/src/Magnum/Vk/Test/FenceVkTest.cpp @@ -72,13 +72,13 @@ void FenceVkTest::constructMove() { Fence a{device()}; VkFence handle = a.handle(); - Fence b = std::move(a); + Fence b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); Fence c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/FramebufferTest.cpp b/src/Magnum/Vk/Test/FramebufferTest.cpp index 40244bcbd..39bde2800 100644 --- a/src/Magnum/Vk/Test/FramebufferTest.cpp +++ b/src/Magnum/Vk/Test/FramebufferTest.cpp @@ -140,7 +140,7 @@ void FramebufferTest::createInfoConstructMove() { FramebufferCreateInfo a{renderPass, {view}, {256, 512}}; - FramebufferCreateInfo b = std::move(a); + FramebufferCreateInfo b = Utility::move(a); CORRADE_COMPARE(a->attachmentCount, 0); CORRADE_VERIFY(!a->pAttachments); CORRADE_COMPARE(b->renderPass, reinterpret_cast(reinterpret_cast(0xdeadbeef))); @@ -149,7 +149,7 @@ void FramebufferTest::createInfoConstructMove() { CORRADE_COMPARE(b->pAttachments[0], reinterpret_cast(reinterpret_cast(0xcafe))); FramebufferCreateInfo c{VkFramebufferCreateInfo{}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->attachmentCount, 0); CORRADE_VERIFY(!b->pAttachments); CORRADE_COMPARE(c->renderPass, reinterpret_cast(reinterpret_cast(0xdeadbeef))); diff --git a/src/Magnum/Vk/Test/FramebufferVkTest.cpp b/src/Magnum/Vk/Test/FramebufferVkTest.cpp index 3d958ad66..482de54c5 100644 --- a/src/Magnum/Vk/Test/FramebufferVkTest.cpp +++ b/src/Magnum/Vk/Test/FramebufferVkTest.cpp @@ -120,14 +120,14 @@ void FramebufferVkTest::constructMove() { }, {256, 256}}}; VkFramebuffer handle = a.handle(); - Framebuffer b = std::move(a); + Framebuffer b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); CORRADE_COMPARE(b.size(), (Vector3i{256, 256, 1})); Framebuffer c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/ImageViewVkTest.cpp b/src/Magnum/Vk/Test/ImageViewVkTest.cpp index a96620538..5b1d3a223 100644 --- a/src/Magnum/Vk/Test/ImageViewVkTest.cpp +++ b/src/Magnum/Vk/Test/ImageViewVkTest.cpp @@ -175,13 +175,13 @@ void ImageViewVkTest::constructMove() { ImageView a{device(), ImageViewCreateInfo2D{image}}; VkImageView handle = a.handle(); - ImageView b = std::move(a); + ImageView b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); ImageView c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/ImageVkTest.cpp b/src/Magnum/Vk/Test/ImageVkTest.cpp index 08b516f64..cdc0c615c 100644 --- a/src/Magnum/Vk/Test/ImageVkTest.cpp +++ b/src/Magnum/Vk/Test/ImageVkTest.cpp @@ -236,7 +236,7 @@ void ImageVkTest::constructMove() { VkImage handle = a.handle(); VkDeviceMemory memoryHandle = a.dedicatedMemory().handle(); - Image b = std::move(a); + Image b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_VERIFY(!a.hasDedicatedMemory()); CORRADE_COMPARE(b.handle(), handle); @@ -246,7 +246,7 @@ void ImageVkTest::constructMove() { CORRADE_COMPARE(b.dedicatedMemory().handle(), memoryHandle); Image c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_VERIFY(!b.hasDedicatedMemory()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); @@ -331,7 +331,7 @@ void ImageVkTest::bindDedicatedMemory() { VkDeviceMemory handle = memory.handle(); CORRADE_VERIFY(handle); - image.bindDedicatedMemory(std::move(memory)); + image.bindDedicatedMemory(Utility::move(memory)); CORRADE_VERIFY(image.hasDedicatedMemory()); CORRADE_COMPARE(image.dedicatedMemory().handle(), handle); } diff --git a/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp b/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp index 5b94d376e..34bf365a8 100644 --- a/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp +++ b/src/Magnum/Vk/Test/LayerPropertiesVkTest.cpp @@ -60,11 +60,11 @@ void LayerPropertiesVkTest::constructMove() { const UnsignedInt count = a.count(); if(!count) CORRADE_SKIP("No extensions reported, can't test"); - LayerProperties b = std::move(a); + LayerProperties b = Utility::move(a); CORRADE_COMPARE(b.count(), count); LayerProperties c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.count(), count); CORRADE_VERIFY(std::is_nothrow_move_constructible::value); diff --git a/src/Magnum/Vk/Test/MemoryVkTest.cpp b/src/Magnum/Vk/Test/MemoryVkTest.cpp index 5b8598ba7..114118c49 100644 --- a/src/Magnum/Vk/Test/MemoryVkTest.cpp +++ b/src/Magnum/Vk/Test/MemoryVkTest.cpp @@ -66,14 +66,14 @@ void MemoryVkTest::constructMove() { Memory a{device(), MemoryAllocateInfo{1024*1024, device().properties().pickMemory(MemoryFlag::DeviceLocal)}}; VkDeviceMemory handle = a.handle(); - Memory b = std::move(a); + Memory b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); CORRADE_COMPARE(b.size(), 1024*1024); Memory c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/MeshLayoutTest.cpp b/src/Magnum/Vk/Test/MeshLayoutTest.cpp index 9a621c2a9..11b379784 100644 --- a/src/Magnum/Vk/Test/MeshLayoutTest.cpp +++ b/src/Magnum/Vk/Test/MeshLayoutTest.cpp @@ -228,7 +228,7 @@ void MeshLayoutTest::constructMove() { a.addInstancedBinding(3, 5, 555) .addAttribute(15, 23, VertexFormat::UnsignedShort, 11); - MeshLayout b = std::move(a); + MeshLayout b = Utility::move(a); CORRADE_VERIFY(!a.vkPipelineVertexInputStateCreateInfo().pNext); CORRADE_COMPARE(a.vkPipelineVertexInputStateCreateInfo().vertexBindingDescriptionCount, 0); CORRADE_VERIFY(!a.vkPipelineVertexInputStateCreateInfo().pVertexBindingDescriptions); @@ -244,7 +244,7 @@ void MeshLayoutTest::constructMove() { CORRADE_COMPARE(b.vkPipelineVertexInputStateCreateInfo().pVertexAttributeDescriptions[0].format, VK_FORMAT_R16_UINT); MeshLayout c{{}, {}}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.vkPipelineVertexInputStateCreateInfo().pNext); CORRADE_COMPARE(b.vkPipelineVertexInputStateCreateInfo().vertexBindingDescriptionCount, 0); CORRADE_VERIFY(!b.vkPipelineVertexInputStateCreateInfo().pVertexBindingDescriptions); diff --git a/src/Magnum/Vk/Test/MeshTest.cpp b/src/Magnum/Vk/Test/MeshTest.cpp index e4a3c8ca8..45fb90ec6 100644 --- a/src/Magnum/Vk/Test/MeshTest.cpp +++ b/src/Magnum/Vk/Test/MeshTest.cpp @@ -157,12 +157,12 @@ void MeshTest::constructMove() { Mesh a{MeshLayout{MeshPrimitive::Triangles}}; a.setCount(15); - Mesh b = std::move(a); + Mesh b = Utility::move(a); CORRADE_COMPARE(b.layout().vkPipelineInputAssemblyStateCreateInfo().topology, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); CORRADE_COMPARE(b.count(), 15); Mesh c{MeshLayout{MeshPrimitive::Points}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c.layout().vkPipelineInputAssemblyStateCreateInfo().topology, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST); CORRADE_COMPARE(c.count(), 15); } @@ -219,8 +219,8 @@ void MeshTest::addVertexBufferOwned() { Device device{NoCreate}; Buffer a = Buffer::wrap(device, reinterpret_cast(reinterpret_cast(0xdead))); Buffer b = Buffer::wrap(device, reinterpret_cast(reinterpret_cast(0xbeef))); - mesh.addVertexBuffer(5, std::move(a), 15) - .addVertexBuffer(1, std::move(b), 37); + mesh.addVertexBuffer(5, Utility::move(a), 15) + .addVertexBuffer(1, Utility::move(b), 37); CORRADE_VERIFY(!a.handle()); CORRADE_VERIFY(!b.handle()); @@ -277,7 +277,7 @@ template void MeshTest::setIndexBufferOwned() { Buffer a = Buffer::wrap(device, reinterpret_cast(reinterpret_cast(0xdead))); Mesh mesh{MeshLayout{MeshPrimitive::Triangles}}; - mesh.setIndexBuffer(std::move(a), 15, T::UnsignedByte); + mesh.setIndexBuffer(Utility::move(a), 15, T::UnsignedByte); CORRADE_VERIFY(!a.handle()); CORRADE_VERIFY(mesh.isIndexed()); CORRADE_COMPARE(mesh.indexBuffer(), reinterpret_cast(reinterpret_cast(0xdead))); diff --git a/src/Magnum/Vk/Test/MeshVkTest.cpp b/src/Magnum/Vk/Test/MeshVkTest.cpp index f8503d7ed..905f56b53 100644 --- a/src/Magnum/Vk/Test/MeshVkTest.cpp +++ b/src/Magnum/Vk/Test/MeshVkTest.cpp @@ -196,7 +196,7 @@ void MeshVkTest::setupRobustness2() { return; /* Create the device only if not already, to avoid spamming the output */ - if(!_deviceRobustness2.handle()) _deviceRobustness2.create(instance(), DeviceCreateInfo{std::move(properties)} + if(!_deviceRobustness2.handle()) _deviceRobustness2.create(instance(), DeviceCreateInfo{Utility::move(properties)} .addQueues(QueueFlag::Graphics, {0.0f}, {_queue}) .addEnabledExtensions() .setEnabledFeatures(DeviceFeature::NullDescriptor) @@ -213,7 +213,7 @@ void MeshVkTest::setupExtendedDynamicState() { return; /* Create the device only if not already, to avoid spamming the output */ - if(!_deviceExtendedDynamicState.handle()) _deviceExtendedDynamicState.create(instance(), DeviceCreateInfo{std::move(properties)} + if(!_deviceExtendedDynamicState.handle()) _deviceExtendedDynamicState.create(instance(), DeviceCreateInfo{Utility::move(properties)} .addQueues(QueueFlag::Graphics, {0.0f}, {_queue}) .addEnabledExtensions() .setEnabledFeatures(DeviceFeature::ExtendedDynamicState) @@ -265,7 +265,7 @@ void MeshVkTest::cmdDraw() { Utility::copy( Containers::stridedArrayView(QuadData).slice(&Quad::position), Containers::arrayCast(Containers::arrayView(buffer.dedicatedMemory().map()))); - mesh.addVertexBuffer(0, std::move(buffer), 0) + mesh.addVertexBuffer(0, Utility::move(buffer), 0) .setCount(4); } @@ -332,7 +332,7 @@ void MeshVkTest::cmdDrawIndexed() { Utility::copy(Containers::arrayCast(QuadIndexData), Containers::stridedArrayView(data).exceptPrefix(32 + 12*4)); mesh.addVertexBuffer(0, buffer, 32) - .setIndexBuffer(std::move(buffer), 32 + 12*4, MeshIndexType::UnsignedShort) + .setIndexBuffer(Utility::move(buffer), 32 + 12*4, MeshIndexType::UnsignedShort) .setCount(6); } @@ -394,7 +394,7 @@ void MeshVkTest::cmdDrawTwoAttributes() { /** @todo ffs fucking casts!!! */ Utility::copy(Containers::arrayCast(QuadData), Containers::stridedArrayView(buffer.dedicatedMemory().map())); - mesh.addVertexBuffer(0, std::move(buffer), 0) + mesh.addVertexBuffer(0, Utility::move(buffer), 0) .setCount(4); } @@ -465,8 +465,8 @@ void MeshVkTest::cmdDrawTwoAttributesTwoBindings() { Containers::arrayCast(Containers::arrayView(positions.dedicatedMemory().map()))); Utility::copy(Containers::stridedArrayView(QuadData).slice(&Quad::color), Containers::arrayCast(Containers::arrayView(colors.dedicatedMemory().map()))); - mesh.addVertexBuffer(0, std::move(positions), 0) - .addVertexBuffer(1, std::move(colors), 0) + mesh.addVertexBuffer(0, Utility::move(positions), 0) + .addVertexBuffer(1, Utility::move(colors), 0) .setCount(4); } @@ -534,7 +534,7 @@ void MeshVkTest::cmdDrawNullBindingRobustness2() { /** @todo ffs fucking casts!!! */ Utility::copy(Containers::stridedArrayView(QuadData).slice(&Quad::position), Containers::arrayCast(Containers::arrayView(positions.dedicatedMemory().map()))); - mesh.addVertexBuffer(0, std::move(positions), 0) + mesh.addVertexBuffer(0, Utility::move(positions), 0) .setCount(4); } @@ -694,7 +694,7 @@ void MeshVkTest::cmdDrawDynamicPrimitive() { Utility::copy( Containers::stridedArrayView(QuadData).slice(&Quad::position), Containers::arrayCast(Containers::arrayView(buffer.dedicatedMemory().map()))); - mesh.addVertexBuffer(0, std::move(buffer), 0) + mesh.addVertexBuffer(0, Utility::move(buffer), 0) .setCount(4); } @@ -769,7 +769,7 @@ void MeshVkTest::cmdDrawDynamicStride() { Utility::copy( Containers::stridedArrayView(QuadData).slice(&Quad::position), Containers::arrayCast(Containers::arrayView(buffer.dedicatedMemory().map()))); - mesh.addVertexBuffer(0, std::move(buffer), 0) + mesh.addVertexBuffer(0, Utility::move(buffer), 0) .setCount(4); } @@ -843,7 +843,7 @@ void MeshVkTest::cmdDrawDynamicStrideInsufficientImplementation() { Utility::copy( Containers::stridedArrayView(QuadData).slice(&Quad::position), Containers::arrayCast(Containers::arrayView(buffer.dedicatedMemory().map()))); - mesh.addVertexBuffer(0, std::move(buffer), 0) + mesh.addVertexBuffer(0, Utility::move(buffer), 0) .setCount(4); } diff --git a/src/Magnum/Vk/Test/PipelineLayoutTest.cpp b/src/Magnum/Vk/Test/PipelineLayoutTest.cpp index 25c204d85..bb56f1498 100644 --- a/src/Magnum/Vk/Test/PipelineLayoutTest.cpp +++ b/src/Magnum/Vk/Test/PipelineLayoutTest.cpp @@ -109,7 +109,7 @@ void PipelineLayoutTest::createInfoConstructMove() { CORRADE_COMPARE(a->setLayoutCount, 2); CORRADE_VERIFY(a->pSetLayouts); - PipelineLayoutCreateInfo b = std::move(a); + PipelineLayoutCreateInfo b = Utility::move(a); CORRADE_COMPARE(a->setLayoutCount, 0); CORRADE_VERIFY(!a->pSetLayouts); CORRADE_COMPARE(b->setLayoutCount, 2); @@ -117,7 +117,7 @@ void PipelineLayoutTest::createInfoConstructMove() { CORRADE_COMPARE(b->pSetLayouts[1], reinterpret_cast(reinterpret_cast(0xbeef))); PipelineLayoutCreateInfo c; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->setLayoutCount, 0); CORRADE_VERIFY(!b->pSetLayouts); CORRADE_COMPARE(c->setLayoutCount, 2); diff --git a/src/Magnum/Vk/Test/PipelineLayoutVkTest.cpp b/src/Magnum/Vk/Test/PipelineLayoutVkTest.cpp index 8395896e5..bb6e44069 100644 --- a/src/Magnum/Vk/Test/PipelineLayoutVkTest.cpp +++ b/src/Magnum/Vk/Test/PipelineLayoutVkTest.cpp @@ -85,13 +85,13 @@ void PipelineLayoutVkTest::constructMove() { PipelineLayout a{device(), PipelineLayoutCreateInfo{}}; VkPipelineLayout handle = a.handle(); - PipelineLayout b = std::move(a); + PipelineLayout b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); PipelineLayout c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/PipelineTest.cpp b/src/Magnum/Vk/Test/PipelineTest.cpp index 98724c771..e33ed593c 100644 --- a/src/Magnum/Vk/Test/PipelineTest.cpp +++ b/src/Magnum/Vk/Test/PipelineTest.cpp @@ -312,7 +312,7 @@ void PipelineTest::rasterizationCreateInfoConstructMove() { (*a).setViewport(Range3D{}) .setDynamicStates(DynamicRasterizationState::CullMode); - Containers::Pointer b{InPlaceInit, std::move(*a)}; + Containers::Pointer b{InPlaceInit, Utility::move(*a)}; CORRADE_COMPARE((**a).stageCount, 0); CORRADE_VERIFY(!(**a).pStages); CORRADE_VERIFY(!(**a).pVertexInputState); @@ -347,7 +347,7 @@ void PipelineTest::rasterizationCreateInfoConstructMove() { CORRADE_COMPARE((**b).pDynamicState->sType, VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO); Containers::Pointer c{InPlaceInit, VkGraphicsPipelineCreateInfo{}}; - *c = std::move(*b); + *c = Utility::move(*b); CORRADE_COMPARE((**b).stageCount, 0); CORRADE_VERIFY(!(**b).pStages); CORRADE_VERIFY(!(**b).pVertexInputState); @@ -410,7 +410,7 @@ void PipelineTest::rasterizationCreateInfoConstructMoveExternalPointers() { a->pDynamicState = &dynamic; /* The external pointers should stay external, not rerouted to internal */ - RasterizationPipelineCreateInfo b = std::move(a); + RasterizationPipelineCreateInfo b = Utility::move(a); CORRADE_COMPARE(b->pViewportState, &viewport); CORRADE_COMPARE(b->pRasterizationState, &rasterization); CORRADE_COMPARE(b->pMultisampleState, &multisample); @@ -419,7 +419,7 @@ void PipelineTest::rasterizationCreateInfoConstructMoveExternalPointers() { CORRADE_COMPARE(b->pDynamicState, &dynamic); RasterizationPipelineCreateInfo c{VkGraphicsPipelineCreateInfo{}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(c->pViewportState, &viewport); CORRADE_COMPARE(c->pRasterizationState, &rasterization); CORRADE_COMPARE(c->pMultisampleState, &multisample); diff --git a/src/Magnum/Vk/Test/PipelineVkTest.cpp b/src/Magnum/Vk/Test/PipelineVkTest.cpp index 3c6965125..f87dfb672 100644 --- a/src/Magnum/Vk/Test/PipelineVkTest.cpp +++ b/src/Magnum/Vk/Test/PipelineVkTest.cpp @@ -328,7 +328,7 @@ void PipelineVkTest::constructMove() { }; VkPipeline handle = a.handle(); - Pipeline b = std::move(a); + Pipeline b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); @@ -336,7 +336,7 @@ void PipelineVkTest::constructMove() { CORRADE_COMPARE(b.dynamicRasterizationStates(), DynamicRasterizationState::LineWidth|DynamicRasterizationState::DepthBias); Pipeline c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/QueueTest.cpp b/src/Magnum/Vk/Test/QueueTest.cpp index 73c4bfe9a..f286c928c 100644 --- a/src/Magnum/Vk/Test/QueueTest.cpp +++ b/src/Magnum/Vk/Test/QueueTest.cpp @@ -84,12 +84,12 @@ void QueueTest::constructMove() { VkQueue handle = a.handle(); CORRADE_VERIFY(a.handle()); - Queue b = std::move(a); + Queue b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); Queue c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(c.handle(), handle); @@ -160,7 +160,7 @@ void QueueTest::submitInfoConstructMove() { SubmitInfo a; a.setCommandBuffers({{}, reinterpret_cast(reinterpret_cast(0xcafecafe))}); - SubmitInfo b = std::move(a); + SubmitInfo b = Utility::move(a); CORRADE_COMPARE(a->commandBufferCount, 0); CORRADE_VERIFY(!a->pCommandBuffers); CORRADE_COMPARE(b->commandBufferCount, 2); @@ -168,7 +168,7 @@ void QueueTest::submitInfoConstructMove() { CORRADE_COMPARE(b->pCommandBuffers[1], reinterpret_cast(reinterpret_cast(0xcafecafe))); SubmitInfo c{VkSubmitInfo{}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->commandBufferCount, 0); CORRADE_VERIFY(!b->pCommandBuffers); CORRADE_COMPARE(c->commandBufferCount, 2); diff --git a/src/Magnum/Vk/Test/RenderPassTest.cpp b/src/Magnum/Vk/Test/RenderPassTest.cpp index 560847a73..5c4af7682 100644 --- a/src/Magnum/Vk/Test/RenderPassTest.cpp +++ b/src/Magnum/Vk/Test/RenderPassTest.cpp @@ -626,14 +626,14 @@ void RenderPassTest::subpassDescriptionConstructMove() { CORRADE_COMPARE(a->inputAttachmentCount, 2); CORRADE_COMPARE(a->pInputAttachments[1].attachment, 35); - SubpassDescription b = std::move(a); + SubpassDescription b = Utility::move(a); CORRADE_COMPARE(a->inputAttachmentCount, 0); CORRADE_VERIFY(!a->pInputAttachments); CORRADE_COMPARE(b->inputAttachmentCount, 2); CORRADE_COMPARE(b->pInputAttachments[1].attachment, 35); SubpassDescription c; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->inputAttachmentCount, 0); CORRADE_VERIFY(!b->pInputAttachments); CORRADE_COMPARE(c->inputAttachmentCount, 2); @@ -1037,14 +1037,14 @@ void RenderPassTest::createInfoConstructMove() { CORRADE_COMPARE(a->attachmentCount, 2); CORRADE_COMPARE(a->pAttachments[1].format, VK_FORMAT_R8G8B8_SNORM); - RenderPassCreateInfo b = std::move(a); + RenderPassCreateInfo b = Utility::move(a); CORRADE_COMPARE(a->attachmentCount, 0); CORRADE_VERIFY(!a->pAttachments); CORRADE_COMPARE(b->attachmentCount, 2); CORRADE_COMPARE(b->pAttachments[1].format, VK_FORMAT_R8G8B8_SNORM); RenderPassCreateInfo c; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->attachmentCount, 0); CORRADE_VERIFY(!b->pAttachments); CORRADE_COMPARE(c->attachmentCount, 2); @@ -1208,14 +1208,14 @@ void RenderPassTest::beginInfoConstructMove() { CORRADE_COMPARE(a->clearValueCount, 6); CORRADE_COMPARE(Color4{a->pClearValues[5].color}, (Color4{0.5f, 0.6f, 0.7f, 0.8f})); - RenderPassBeginInfo b = std::move(a); + RenderPassBeginInfo b = Utility::move(a); CORRADE_COMPARE(a->clearValueCount, 0); CORRADE_VERIFY(!a->pClearValues); CORRADE_COMPARE(b->clearValueCount, 6); CORRADE_COMPARE(Color4{b->pClearValues[5].color}, (Color4{0.5f, 0.6f, 0.7f, 0.8f})); RenderPassBeginInfo c{VkRenderPassBeginInfo{}}; - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b->clearValueCount, 0); CORRADE_VERIFY(!b->pClearValues); CORRADE_COMPARE(c->clearValueCount, 6); diff --git a/src/Magnum/Vk/Test/RenderPassVkTest.cpp b/src/Magnum/Vk/Test/RenderPassVkTest.cpp index 28a20275a..559568a80 100644 --- a/src/Magnum/Vk/Test/RenderPassVkTest.cpp +++ b/src/Magnum/Vk/Test/RenderPassVkTest.cpp @@ -125,13 +125,13 @@ void RenderPassVkTest::constructMove() { }; VkRenderPass handle = a.handle(); - RenderPass b = std::move(a); + RenderPass b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); RenderPass c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/SamplerVkTest.cpp b/src/Magnum/Vk/Test/SamplerVkTest.cpp index b27ac01f9..08e06d769 100644 --- a/src/Magnum/Vk/Test/SamplerVkTest.cpp +++ b/src/Magnum/Vk/Test/SamplerVkTest.cpp @@ -62,13 +62,13 @@ void SamplerVkTest::constructMove() { Sampler a{device(), SamplerCreateInfo{}}; VkSampler handle = a.handle(); - Sampler b = std::move(a); + Sampler b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); Sampler c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/Test/ShaderSetTest.cpp b/src/Magnum/Vk/Test/ShaderSetTest.cpp index b0f633ef1..0e75d9673 100644 --- a/src/Magnum/Vk/Test/ShaderSetTest.cpp +++ b/src/Magnum/Vk/Test/ShaderSetTest.cpp @@ -154,7 +154,7 @@ void ShaderSetTest::constructMove() { /* This specialization info points elsewhere */ CORRADE_COMPARE(a.stages()[1].pSpecializationInfo, &externalSpecializationInfo2); - ShaderSet b = std::move(a); + ShaderSet b = Utility::move(a); CORRADE_VERIFY(a.stages().isEmpty()); CORRADE_COMPARE(b.stages().size(), 2); CORRADE_COMPARE(b.stages()[0].pName, "main"_s); @@ -176,7 +176,7 @@ void ShaderSetTest::constructMove() { /* This specialization info should not be redirected anywhere */ CORRADE_COMPARE(b.stages()[1].pSpecializationInfo, &externalSpecializationInfo2); - c = std::move(b); + c = Utility::move(b); CORRADE_COMPARE(b.stages().size(), 2); CORRADE_COMPARE(b.stages()[0].pName, "mine"_s); /* The two classes got swapped, so the original C content should now @@ -345,7 +345,7 @@ void ShaderSetTest::addShaderOwnershipTransfer() { auto shader = Shader::wrap(device, reinterpret_cast(reinterpret_cast(0xdeadbeef))); ShaderSet set; - set.addShader(ShaderStage::RayAnyHit, std::move(shader), "main"_s, { + set.addShader(ShaderStage::RayAnyHit, Utility::move(shader), "main"_s, { {13, 1227} }); diff --git a/src/Magnum/Vk/Test/ShaderTest.cpp b/src/Magnum/Vk/Test/ShaderTest.cpp index d140df802..af689c8e7 100644 --- a/src/Magnum/Vk/Test/ShaderTest.cpp +++ b/src/Magnum/Vk/Test/ShaderTest.cpp @@ -256,7 +256,7 @@ void ShaderTest::createInfoConstructMove() { /* Besides the deleter, the original code pointer and size should also be cleared because it will inevitably become dangling */ - ShaderCreateInfo b = std::move(a); + ShaderCreateInfo b = Utility::move(a); CORRADE_VERIFY(!a->pCode); CORRADE_COMPARE(a->codeSize, 0); CORRADE_COMPARE(b->pCode, data); @@ -266,7 +266,7 @@ void ShaderTest::createInfoConstructMove() { ShaderCreateInfo c{NoInit}; c->pCode = &data[1]; c->codeSize = 2; - c = std::move(b); + c = Utility::move(b); /* It just swaps, so the moved-from instance doesn't have the code pointer cleared */ CORRADE_COMPARE(b->pCode, &data[1]); diff --git a/src/Magnum/Vk/Test/ShaderVkTest.cpp b/src/Magnum/Vk/Test/ShaderVkTest.cpp index 96f736186..f9c05ba02 100644 --- a/src/Magnum/Vk/Test/ShaderVkTest.cpp +++ b/src/Magnum/Vk/Test/ShaderVkTest.cpp @@ -77,13 +77,13 @@ void ShaderVkTest::constructMove() { Shader a{device(), ShaderCreateInfo{*data}}; VkShaderModule handle = a.handle(); - Shader b = std::move(a); + Shader b = Utility::move(a); CORRADE_VERIFY(!a.handle()); CORRADE_COMPARE(b.handle(), handle); CORRADE_COMPARE(b.handleFlags(), HandleFlag::DestroyOnDestruction); Shader c{NoCreate}; - c = std::move(b); + c = Utility::move(b); CORRADE_VERIFY(!b.handle()); CORRADE_COMPARE(b.handleFlags(), HandleFlags{}); CORRADE_COMPARE(c.handle(), handle); diff --git a/src/Magnum/Vk/VulkanTester.cpp b/src/Magnum/Vk/VulkanTester.cpp index 9627d1efb..d8fa5d4c7 100644 --- a/src/Magnum/Vk/VulkanTester.cpp +++ b/src/Magnum/Vk/VulkanTester.cpp @@ -36,7 +36,7 @@ namespace Magnum { namespace Vk { VulkanTester::VulkanTester(): VulkanTester{NoCreate} { DeviceProperties deviceProperties = pickDevice(_instance); UnsignedInt graphicsQueue = deviceProperties.pickQueueFamily(Vk::QueueFlag::Graphics); - _device.create(_instance, Vk::DeviceCreateInfo{std::move(deviceProperties)} + _device.create(_instance, Vk::DeviceCreateInfo{Utility::move(deviceProperties)} .addQueues(graphicsQueue, {0.0f}, {_queue}) ); } diff --git a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp index bb19ece5b..6992932ee 100644 --- a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp +++ b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp @@ -95,7 +95,7 @@ void AnyImporter::doOpenFile(const std::string& filename) { if(!importer->openFile(filename)) return; /* Success, save the instance */ - _in = std::move(importer); + _in = Utility::move(importer); } BufferFormat AnyImporter::doFormat() const { return _in->format(); } diff --git a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp index bed90b531..2de47a941 100644 --- a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp +++ b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp @@ -186,7 +186,7 @@ void AnyImageImporter::doOpenFile(const Containers::StringView filename) { if(!importer->openFile(filename)) return; /* Success, save the instance */ - _in = std::move(importer); + _in = Utility::move(importer); } void AnyImageImporter::doOpenData(Containers::Array&& data, DataFlags) { @@ -313,7 +313,7 @@ void AnyImageImporter::doOpenData(Containers::Array&& data, DataFlags) { if(!importer->openData(data)) return; /* Success, save the instance */ - _in = std::move(importer); + _in = Utility::move(importer); } UnsignedInt AnyImageImporter::doImage1DCount() const { return _in->image1DCount(); } diff --git a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp index d39f090ef..1a5ad056d 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp +++ b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp @@ -491,7 +491,7 @@ void AnyImageImporterTest::propagateFileCallback() { importer->setFileCallback([](const std::string&, InputFileCallbackPolicy, Containers::Array& storage) -> Containers::Optional> { Containers::Optional> data = Utility::Path::read(Utility::Path::join(ANYIMAGEIMPORTER_TEST_DIR, "rgb.tga")); CORRADE_VERIFY(data); - storage = *std::move(data); + storage = *Utility::move(data); return Containers::ArrayView{storage}; }, storage); diff --git a/src/MagnumPlugins/AnySceneConverter/AnySceneConverter.cpp b/src/MagnumPlugins/AnySceneConverter/AnySceneConverter.cpp index 0099243d4..129160ffd 100644 --- a/src/MagnumPlugins/AnySceneConverter/AnySceneConverter.cpp +++ b/src/MagnumPlugins/AnySceneConverter/AnySceneConverter.cpp @@ -172,7 +172,7 @@ bool AnySceneConverter::doBeginFile(const Containers::StringView filename) { if(!converter->beginFile(filename)) return false; /* Success, save the instance */ - _converter = std::move(converter); + _converter = Utility::move(converter); return true; } diff --git a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp index d1b081488..b2ec6b543 100644 --- a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp +++ b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp @@ -177,7 +177,7 @@ void AnySceneImporter::doOpenFile(const Containers::StringView filename) { if(!importer->openFile(filename)) return; /* Success, save the instance */ - _in = std::move(importer); + _in = Utility::move(importer); } UnsignedInt AnySceneImporter::doAnimationCount() const { return _in->animationCount(); } diff --git a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp index 4388f5dbf..0bc7427ba 100644 --- a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp +++ b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp @@ -385,7 +385,7 @@ void AnySceneImporterTest::propagateFileCallback() { importer->setFileCallback([](const std::string&, InputFileCallbackPolicy, Containers::Array& storage) -> Containers::Optional> { Containers::Optional> data = Utility::Path::read(Utility::Path::join(OBJIMPORTER_TEST_DIR, "mesh-multiple.obj")); CORRADE_VERIFY(data); - storage = *std::move(data); + storage = *Utility::move(data); return Containers::ArrayView{storage}; }, storage); diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp index 450cf06ae..5161301cf 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp @@ -115,7 +115,7 @@ auto MagnumFont::doOpenData(const Containers::ArrayView data, const if(!_opened->image) return {}; /* Everything okay, save the data internally */ - _opened->conf = std::move(conf); + _opened->conf = Utility::move(conf); /* Glyph advances */ const std::vector glyphs = _opened->conf.groups("glyph"); @@ -180,12 +180,12 @@ Containers::Pointer MagnumFont::doLayout(const AbstractGlyphCa glyphs.push_back(it == _opened->glyphId.end() ? 0 : it->second); } - return Containers::Pointer(new MagnumFontLayouter(_opened->glyphAdvance, cache, this->size(), size, std::move(glyphs))); + return Containers::Pointer(new MagnumFontLayouter(_opened->glyphAdvance, cache, this->size(), size, Utility::move(glyphs))); } namespace { -MagnumFontLayouter::MagnumFontLayouter(const std::vector& glyphAdvance, const AbstractGlyphCache& cache, const Float fontSize, const Float textSize, std::vector&& glyphs): AbstractLayouter(glyphs.size()), glyphAdvance(glyphAdvance), cache(cache), fontSize(fontSize), textSize(textSize), glyphs(std::move(glyphs)) {} +MagnumFontLayouter::MagnumFontLayouter(const std::vector& glyphAdvance, const AbstractGlyphCache& cache, const Float fontSize, const Float textSize, std::vector&& glyphs): AbstractLayouter(glyphs.size()), glyphAdvance(glyphAdvance), cache(cache), fontSize(fontSize), textSize(textSize), glyphs(Utility::move(glyphs)) {} std::tuple MagnumFontLayouter::doRenderGlyph(const UnsignedInt i) { /* Position of the texture in the resulting glyph, texture coordinates */ diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp index 6e419ff7a..8a7d5ff74 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp @@ -155,8 +155,8 @@ void MagnumFontTest::fileCallbackImage() { Utility::Path::read(Utility::Path::join(MAGNUMFONT_TEST_DIR, "font.tga")); CORRADE_VERIFY(conf); CORRADE_VERIFY(tga); - files["not/a/path/font.conf"] = *std::move(conf); - files["not/a/path/font.tga"] = *std::move(tga); + files["not/a/path/font.conf"] = *Utility::move(conf); + files["not/a/path/font.tga"] = *Utility::move(tga); font->setFileCallback([](const std::string& filename, InputFileCallbackPolicy policy, std::unordered_map>& files) { Debug{} << "Loading" << filename << "with" << policy; diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp index 6fe0316e9..e14d96ef9 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -126,8 +126,8 @@ std::vector>> MagnumFontConverter if(!tgaData) return {}; std::vector>> out; - out.emplace_back(filename + ".conf", std::move(confData)); - out.emplace_back(filename + ".tga", *std::move(tgaData)); + out.emplace_back(filename + ".conf", Utility::move(confData)); + out.emplace_back(filename + ".tga", *Utility::move(tgaData)); return out; } diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index 69c9263c9..dc94f29c7 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -104,7 +104,7 @@ void ObjImporter::doOpenFile(const Containers::StringView filename) { } _file.reset(new File); - _file->in = std::move(in); + _file->in = Utility::move(in); parseMeshNames(); } @@ -156,7 +156,7 @@ void ObjImporter::parseMeshNames() { /* Update its name and add it to name map */ if(!name.empty()) _file->meshesForName.emplace(name, _file->meshes.size() - 1); - _file->meshNames.back() = std::move(name); + _file->meshNames.back() = Utility::move(name); /* Update its begin offset to be more precise */ std::get<0>(_file->meshes.back()) = _file->in->tellg(); @@ -170,7 +170,7 @@ void ObjImporter::parseMeshNames() { updated later. */ if(!name.empty()) _file->meshesForName.emplace(name, _file->meshes.size()); - _file->meshNames.emplace_back(std::move(name)); + _file->meshNames.emplace_back(Utility::move(name)); _file->meshes.emplace_back(_file->in->tellg(), 0, positionIndexOffset, textureCoordinateIndexOffset, normalIndexOffset); } @@ -482,8 +482,8 @@ Containers::Optional ObjImporter::doMesh(UnsignedInt id, UnsignedInt) CORRADE_INTERNAL_ASSERT(offset == stride && attributeIndex == attributeCount); return MeshData{*primitive, - std::move(indexData), Trade::MeshIndexData{indexDataI}, - std::move(vertexData), std::move(attributeData)}; + Utility::move(indexData), Trade::MeshIndexData{indexDataI}, + Utility::move(vertexData), Utility::move(attributeData)}; } }} diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp index a3f6133b9..c5ea6981e 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp @@ -307,7 +307,7 @@ Containers::Optional> TgaImageConverter::doConvertToData if(rle) arrayShrink(data); /* GCC 4.8 needs extra help here */ - return Containers::optional(std::move(data)); + return Containers::optional(Utility::move(data)); } }} diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index 6ecdfd55f..c06b39723 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -68,7 +68,7 @@ void TgaImporter::doOpenData(Containers::Array&& data, const DataFlags dat /* Ttake over the existing array or copy the data if we can't */ if(dataFlags & (DataFlag::Owned|DataFlag::ExternallyOwned)) { - _in = std::move(data); + _in = Utility::move(data); } else { _in = Containers::Array{NoInit, data.size()}; Utility::copy(data, _in); @@ -257,7 +257,7 @@ Containers::Optional TgaImporter::doImage2D(UnsignedInt, UnsignedIn pixel = Math::gather<'b', 'g', 'r', 'a'>(pixel); } - return ImageData2D{storage, format, size, std::move(data)}; + return ImageData2D{storage, format, size, Utility::move(data)}; } }}