Filesystem: Declare FileInfo iterator's move constructor and assignment operator noexcept

Prevents potential extra copies being created in the context of
std::move_if_noexcept.
This commit is contained in:
Lioncash 2017-08-05 12:28:24 -04:00
parent 6077c7fc69
commit 01c262fe47
1 changed files with 2 additions and 2 deletions

View File

@ -33,14 +33,14 @@ public:
const_iterator() : m_file_info(nullptr) {}
const_iterator(std::unique_ptr<FileInfo> file_info) : m_file_info(std::move(file_info)) {}
const_iterator(const const_iterator& it) : m_file_info(it.m_file_info->clone()) {}
const_iterator(const_iterator&& it) : m_file_info(std::move(it.m_file_info)) {}
const_iterator(const_iterator&& it) noexcept : m_file_info(std::move(it.m_file_info)) {}
~const_iterator() = default;
const_iterator& operator=(const const_iterator& it)
{
m_file_info = it.m_file_info ? it.m_file_info->clone() : nullptr;
return *this;
}
const_iterator& operator=(const_iterator&& it)
const_iterator& operator=(const_iterator&& it) noexcept
{
m_file_info = std::move(it.m_file_info);
return *this;