From 747eb149d06d9077e7b44aa1edd966e637386f33 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Tue, 25 Sep 2018 11:16:22 -0700 Subject: Add noexcept to move constructors and assignment operators. Bug: 116614593 Test: build with WITH_TIDY=1 Change-Id: I5a7461386946ca623ab509609092aa0ac8418b80 --- libutils/FileMap.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'libutils/FileMap.cpp') diff --git a/libutils/FileMap.cpp b/libutils/FileMap.cpp index 583c6b9e4..5feb2aa76 100644 --- a/libutils/FileMap.cpp +++ b/libutils/FileMap.cpp @@ -62,11 +62,17 @@ FileMap::FileMap(void) } // Move Constructor. -FileMap::FileMap(FileMap&& other) - : mFileName(other.mFileName), mBasePtr(other.mBasePtr), mBaseLength(other.mBaseLength), - mDataOffset(other.mDataOffset), mDataPtr(other.mDataPtr), mDataLength(other.mDataLength) +FileMap::FileMap(FileMap&& other) noexcept + : mFileName(other.mFileName), + mBasePtr(other.mBasePtr), + mBaseLength(other.mBaseLength), + mDataOffset(other.mDataOffset), + mDataPtr(other.mDataPtr), + mDataLength(other.mDataLength) #if defined(__MINGW32__) - , mFileHandle(other.mFileHandle), mFileMapping(other.mFileMapping) + , + mFileHandle(other.mFileHandle), + mFileMapping(other.mFileMapping) #endif { other.mFileName = nullptr; @@ -79,7 +85,7 @@ FileMap::FileMap(FileMap&& other) } // Move assign operator. -FileMap& FileMap::operator=(FileMap&& other) { +FileMap& FileMap::operator=(FileMap&& other) noexcept { mFileName = other.mFileName; mBasePtr = other.mBasePtr; mBaseLength = other.mBaseLength; -- cgit v1.2.3