diff --git a/src/Magnum/AbstractQuery.h b/src/Magnum/AbstractQuery.h index d5c8e3c47..c00cac466 100644 --- a/src/Magnum/AbstractQuery.h +++ b/src/Magnum/AbstractQuery.h @@ -186,8 +186,9 @@ inline AbstractQuery::AbstractQuery(AbstractQuery&& other) noexcept: _id(other._ } inline AbstractQuery& AbstractQuery::operator=(AbstractQuery&& other) noexcept { - std::swap(_id, other._id); - std::swap(_target, other._target); + using std::swap; + swap(_id, other._id); + swap(_target, other._target); return *this; } diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 4e30cdb06..6b64456df 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -245,7 +245,8 @@ AbstractShaderProgram::~AbstractShaderProgram() { } AbstractShaderProgram& AbstractShaderProgram::operator=(AbstractShaderProgram&& other) noexcept { - std::swap(_id, other._id); + using std::swap; + swap(_id, other._id); return *this; } diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 0c95f6229..8a828dc68 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -638,9 +638,10 @@ inline AbstractTexture::AbstractTexture(AbstractTexture&& other) noexcept: _targ } inline AbstractTexture& AbstractTexture::operator=(AbstractTexture&& other) noexcept { - std::swap(_target, other._target); - std::swap(_id, other._id); - std::swap(_created, other._created); + using std::swap; + swap(_target, other._target); + swap(_id, other._id); + swap(_created, other._created); return *this; } diff --git a/src/Magnum/Audio/Buffer.h b/src/Magnum/Audio/Buffer.h index 69d5ea3c8..5d33e90ca 100644 --- a/src/Magnum/Audio/Buffer.h +++ b/src/Magnum/Audio/Buffer.h @@ -112,7 +112,8 @@ inline Buffer::Buffer(Buffer&& other): _id(other._id) { } inline Buffer& Buffer::operator=(Buffer&& other) { - std::swap(_id, other._id); + using std::swap; + swap(_id, other._id); return *this; } diff --git a/src/Magnum/Audio/Source.h b/src/Magnum/Audio/Source.h index a101ea067..293201f56 100644 --- a/src/Magnum/Audio/Source.h +++ b/src/Magnum/Audio/Source.h @@ -594,7 +594,8 @@ inline Source::Source(Source&& other): _id(other._id) { } inline Source& Source::operator=(Source&& other) { - std::swap(_id, other._id); + using std::swap; + swap(_id, other._id); return *this; } diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index ae3e5d985..005ccfa4a 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -1307,12 +1307,13 @@ inline Buffer::Buffer(Buffer&& other) noexcept: _id{other._id}, _targetHint{othe } inline Buffer& Buffer::operator=(Buffer&& other) noexcept { - std::swap(_id, other._id); - std::swap(_targetHint, other._targetHint); + using std::swap; + swap(_id, other._id); + swap(_targetHint, other._targetHint); #ifdef CORRADE_TARGET_NACL - std::swap(_mappedBuffer, other._mappedBuffer); + swap(_mappedBuffer, other._mappedBuffer); #endif - std::swap(_created, other._created); + swap(_created, other._created); return *this; } diff --git a/src/Magnum/BufferImage.h b/src/Magnum/BufferImage.h index c9538da71..f8b9c8e80 100644 --- a/src/Magnum/BufferImage.h +++ b/src/Magnum/BufferImage.h @@ -145,8 +145,9 @@ template inline BufferImage::BufferImage(Buf template inline BufferImage& BufferImage::operator=(BufferImage&& other) noexcept { AbstractImage::operator=(std::move(other)); - std::swap(_size, other._size); - std::swap(_buffer, other._buffer); + using std::swap; + swap(_size, other._size); + swap(_buffer, other._buffer); return *this; } #else diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index 1c3e07c3e..5034d5c7f 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -701,9 +701,10 @@ inline Framebuffer::Framebuffer(Framebuffer&& other) noexcept { } inline Framebuffer& Framebuffer::operator=(Framebuffer&& other) noexcept { - std::swap(_id, other._id); - std::swap(_viewport, other._viewport); - std::swap(_created, other._created); + using std::swap; + swap(_id, other._id); + swap(_viewport, other._viewport); + swap(_created, other._created); return *this; } diff --git a/src/Magnum/Image.h b/src/Magnum/Image.h index a9800a75d..a3da46395 100644 --- a/src/Magnum/Image.h +++ b/src/Magnum/Image.h @@ -165,8 +165,9 @@ template inline Image::Image(Image inline Image& Image::operator=(Image&& other) noexcept { AbstractImage::operator=(std::move(other)); - std::swap(_size, other._size); - std::swap(_data, other._data); + using std::swap; + swap(_size, other._size); + swap(_data, other._data); return *this; } diff --git a/src/Magnum/Math/Algorithms/GaussJordan.h b/src/Magnum/Math/Algorithms/GaussJordan.h index 7d69813c0..b00f02d27 100644 --- a/src/Magnum/Math/Algorithms/GaussJordan.h +++ b/src/Magnum/Math/Algorithms/GaussJordan.h @@ -62,8 +62,9 @@ template bool gaussJordanInPlaceTra rowMax = row2; /* Swap the rows */ - std::swap(a[row], a[rowMax]); - std::swap(t[row], t[rowMax]); + using std::swap; + swap(a[row], a[rowMax]); + swap(t[row], t[rowMax]); /* Singular */ if(TypeTraits::equals(a[row][row], T(0))) diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index 66d01204a..73054d02d 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -190,9 +190,10 @@ template inline typename std::enable_if::value, s return a < b ? std::make_pair(a, b) : std::make_pair(b, a); } template std::pair, Vector> minmax(const Vector& a, const Vector& b) { + using std::swap; std::pair, Vector> out{a, b}; for(std::size_t i = 0; i != size; ++i) - if(out.first[i] > out.second[i]) std::swap(out.first[i], out.second[i]); + if(out.first[i] > out.second[i]) swap(out.first[i], out.second[i]); return out; } #endif diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index 4b0b0378a..6113634b2 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -132,27 +132,28 @@ Mesh::Mesh(Mesh&& other) noexcept: _id(other._id), _created{other._created}, _pr } Mesh& Mesh::operator=(Mesh&& other) noexcept { - std::swap(_id, other._id); - std::swap(_created, other._created); - std::swap(_primitive, other._primitive); - std::swap(_count, other._count); - std::swap(_baseVertex, other._baseVertex); - std::swap(_instanceCount, other._instanceCount); + using std::swap; + swap(_id, other._id); + swap(_created, other._created); + swap(_primitive, other._primitive); + swap(_count, other._count); + swap(_baseVertex, other._baseVertex); + swap(_instanceCount, other._instanceCount); #ifndef MAGNUM_TARGET_GLES - std::swap(_baseInstance, other._baseInstance); + swap(_baseInstance, other._baseInstance); #endif #ifndef MAGNUM_TARGET_GLES2 - std::swap(_indexStart, other._indexStart); - std::swap(_indexEnd, other._indexEnd); + swap(_indexStart, other._indexStart); + swap(_indexEnd, other._indexEnd); #endif - std::swap(_indexOffset, other._indexOffset); - std::swap(_indexType, other._indexType); - std::swap(_indexBuffer, other._indexBuffer); - std::swap(_attributes, other._attributes); + swap(_indexOffset, other._indexOffset); + swap(_indexType, other._indexType); + swap(_indexBuffer, other._indexBuffer); + swap(_attributes, other._attributes); #ifndef MAGNUM_TARGET_GLES2 - std::swap(_integerAttributes, other._integerAttributes); + swap(_integerAttributes, other._integerAttributes); #ifndef MAGNUM_TARGET_GLES - std::swap(_longAttributes, other._longAttributes); + swap(_longAttributes, other._longAttributes); #endif #endif diff --git a/src/Magnum/MeshTools/CombineIndexedArrays.h b/src/Magnum/MeshTools/CombineIndexedArrays.h index a8345ca3b..38a5e50a3 100644 --- a/src/Magnum/MeshTools/CombineIndexedArrays.h +++ b/src/Magnum/MeshTools/CombineIndexedArrays.h @@ -131,7 +131,8 @@ template void writeCombinedArray(const UnsignedInt stride, const Unsign CORRADE_ASSERT(index < array.size(), "MeshTools::combineIndexedArrays(): index out of range", ); output.push_back(array[index]); } - std::swap(output, array); + using std::swap; + swap(output, array); } /* Terminator for recursive calls */ diff --git a/src/Magnum/MeshTools/FlipNormals.cpp b/src/Magnum/MeshTools/FlipNormals.cpp index 72716bfb3..b471ffafd 100644 --- a/src/Magnum/MeshTools/FlipNormals.cpp +++ b/src/Magnum/MeshTools/FlipNormals.cpp @@ -32,8 +32,9 @@ namespace Magnum { namespace MeshTools { void flipFaceWinding(std::vector& indices) { CORRADE_ASSERT(!(indices.size()%3), "MeshTools::flipNormals(): index count is not divisible by 3!", ); + using std::swap; for(std::size_t i = 0; i != indices.size(); i += 3) - std::swap(indices[i+1], indices[i+2]); + swap(indices[i+1], indices[i+2]); } void flipNormals(std::vector& normals) { diff --git a/src/Magnum/MeshTools/Tipsify.cpp b/src/Magnum/MeshTools/Tipsify.cpp index c5b001526..d488de832 100644 --- a/src/Magnum/MeshTools/Tipsify.cpp +++ b/src/Magnum/MeshTools/Tipsify.cpp @@ -125,7 +125,8 @@ void Tipsify::operator()(std::size_t cacheSize) { } /* Swap original index buffer with optimized */ - std::swap(indices, outputIndices); + using std::swap; + swap(indices, outputIndices); } void Tipsify::buildAdjacency(std::vector& liveTriangleCount, std::vector& neighborOffset, std::vector& neighbors) const { diff --git a/src/Magnum/Renderbuffer.h b/src/Magnum/Renderbuffer.h index 74b1f4ecd..d0de19b24 100644 --- a/src/Magnum/Renderbuffer.h +++ b/src/Magnum/Renderbuffer.h @@ -222,8 +222,9 @@ inline Renderbuffer::Renderbuffer(Renderbuffer&& other) noexcept: _id{other._id} } inline Renderbuffer& Renderbuffer::operator=(Renderbuffer&& other) noexcept { - std::swap(_id, other._id); - std::swap(_created, other._created); + using std::swap; + swap(_id, other._id); + swap(_created, other._created); return *this; } diff --git a/src/Magnum/Shader.h b/src/Magnum/Shader.h index 096024175..fcdec21b5 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/Shader.h @@ -576,9 +576,10 @@ inline Shader::Shader(Shader&& other) noexcept: _type(other._type), _id(other._i } inline Shader& Shader::operator=(Shader&& other) noexcept { - std::swap(_type, other._type); - std::swap(_id, other._id); - std::swap(_sources, other._sources); + using std::swap; + swap(_type, other._type); + swap(_id, other._id); + swap(_sources, other._sources); return *this; } diff --git a/src/Magnum/Shapes/Composition.cpp b/src/Magnum/Shapes/Composition.cpp index 04bb02d16..a31a1abd5 100644 --- a/src/Magnum/Shapes/Composition.cpp +++ b/src/Magnum/Shapes/Composition.cpp @@ -91,8 +91,9 @@ template Composition& Composition Composition& Composition::operator=(Composition&& other) { - std::swap(other._shapes, _shapes); - std::swap(other._nodes, _nodes); + using std::swap; + swap(other._shapes, _shapes); + swap(other._nodes, _nodes); return *this; } diff --git a/src/Magnum/Trade/ImageData.h b/src/Magnum/Trade/ImageData.h index ddca34e5b..79c6cb4ba 100644 --- a/src/Magnum/Trade/ImageData.h +++ b/src/Magnum/Trade/ImageData.h @@ -136,8 +136,9 @@ template inline ImageData::ImageData(ImageDa template inline ImageData& ImageData::operator=(ImageData&& other) noexcept { AbstractImage::operator=(std::move(other)); - std::swap(_size, other._size); - std::swap(_data, other._data); + using std::swap; + swap(_size, other._size); + swap(_data, other._data); return *this; } diff --git a/src/Magnum/TransformFeedback.h b/src/Magnum/TransformFeedback.h index 499593823..7566be996 100644 --- a/src/Magnum/TransformFeedback.h +++ b/src/Magnum/TransformFeedback.h @@ -376,8 +376,9 @@ inline TransformFeedback::TransformFeedback(TransformFeedback&& other) noexcept: } inline TransformFeedback& TransformFeedback::operator=(TransformFeedback&& other) noexcept { - std::swap(_id, other._id); - std::swap(_created, other._created); + using std::swap; + swap(_id, other._id); + swap(_created, other._created); return *this; }