diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-08-22 15:42:36 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-08-23 11:48:53 +0200 |
commit | 63dfd069b3a957361881c12ccba38c5a23b9a42f (patch) | |
tree | e7a9bd1027b19f44a7c58ea9c445ded435c838bc /vcl | |
parent | 61ed17cafc90d9b4303b52260f729638eed107c7 (diff) |
Mark move ctors/assignments noexcept
This should enable using move semantics where possible e.g. in standard
containers.
According to https://en.cppreference.com/w/cpp/language/move_constructor:
To make strong exception guarantee possible, user-defined move
constructors should not throw exceptions. For example, std::vector
relies on std::move_if_noexcept to choose between move and copy
when the elements need to be relocated.
Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb
Reviewed-on: https://gerrit.libreoffice.org/77957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/impgraph.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/opengl/texture.hxx | 2 | ||||
-rw-r--r-- | vcl/opengl/texture.cxx | 2 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/graph.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 2 | ||||
-rw-r--r-- | vcl/source/treelist/transfer.cxx | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 76e00febcbde..8837dc63903c 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -106,7 +106,7 @@ private: public: ImpGraphic(); ImpGraphic( const ImpGraphic& rImpGraphic ); - ImpGraphic( ImpGraphic&& rImpGraphic ); + ImpGraphic( ImpGraphic&& rImpGraphic ) noexcept; ImpGraphic( const GraphicExternalLink& rExternalLink); ImpGraphic( const Bitmap& rBmp ); ImpGraphic( const BitmapEx& rBmpEx ); diff --git a/vcl/inc/opengl/texture.hxx b/vcl/inc/opengl/texture.hxx index 98bd79977ff4..384e2a879097 100644 --- a/vcl/inc/opengl/texture.hxx +++ b/vcl/inc/opengl/texture.hxx @@ -91,7 +91,7 @@ public: OpenGLTexture( int nWidth, int nHeight, int nFormat, int nType, void const * pData ); OpenGLTexture( int nX, int nY, int nWidth, int nHeight ); OpenGLTexture( const OpenGLTexture& rTexture ); - OpenGLTexture( OpenGLTexture&& rTexture ); + OpenGLTexture( OpenGLTexture&& rTexture ) noexcept; OpenGLTexture( const OpenGLTexture& rTexture, int nX, int nY, int nWidth, int nHeight ); ~OpenGLTexture(); diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx index 157bf51fa562..3b575e9bfcfe 100644 --- a/vcl/opengl/texture.cxx +++ b/vcl/opengl/texture.cxx @@ -307,7 +307,7 @@ OpenGLTexture::OpenGLTexture(const OpenGLTexture& rTexture) mpImpl->IncreaseRefCount(mnSlotNumber); } -OpenGLTexture::OpenGLTexture(OpenGLTexture&& rTexture) +OpenGLTexture::OpenGLTexture(OpenGLTexture&& rTexture) noexcept : maRect(rTexture.maRect) , mpImpl(std::move(rTexture.mpImpl)) , mnSlotNumber(rTexture.mnSlotNumber) diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index cfaad6c7faf6..a24fddf31023 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -220,7 +220,7 @@ Bitmap& Bitmap::operator=( const Bitmap& rBitmap ) return *this; } -Bitmap& Bitmap::operator=( Bitmap&& rBitmap ) +Bitmap& Bitmap::operator=( Bitmap&& rBitmap ) noexcept { maPrefSize = std::move(rBitmap.maPrefSize); maPrefMapMode = std::move(rBitmap.maPrefMapMode); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 89c02b677fd7..06d9c80d321a 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -191,7 +191,7 @@ Graphic::Graphic(const Graphic& rGraphic) mxImpGraphic = rGraphic.mxImpGraphic; } -Graphic::Graphic(Graphic&& rGraphic) +Graphic::Graphic(Graphic&& rGraphic) noexcept : mxImpGraphic(std::move(rGraphic.mxImpGraphic)) { } @@ -275,7 +275,7 @@ Graphic& Graphic::operator=( const Graphic& rGraphic ) return *this; } -Graphic& Graphic::operator=(Graphic&& rGraphic) +Graphic& Graphic::operator=(Graphic&& rGraphic) noexcept { mxImpGraphic = std::move(rGraphic.mxImpGraphic); return *this; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 252a4fc9c979..69e578d0e235 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -211,7 +211,7 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic) } } -ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) +ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) noexcept : maMetaFile(std::move(rImpGraphic.maMetaFile)) , maEx(std::move(rImpGraphic.maEx)) , maSwapInfo(std::move(rImpGraphic.maSwapInfo)) diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index e187dd9e8876..9bb5456d7be2 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -1141,7 +1141,7 @@ TransferableDataHelper::TransferableDataHelper(const TransferableDataHelper& rDa { } -TransferableDataHelper::TransferableDataHelper(TransferableDataHelper&& rDataHelper) +TransferableDataHelper::TransferableDataHelper(TransferableDataHelper&& rDataHelper) noexcept : mxTransfer(std::move(rDataHelper.mxTransfer)) , mxClipboard(std::move(rDataHelper.mxClipboard)) , maFormats(std::move(rDataHelper.maFormats)) |