From 03a68a91bbf3236472e41721192a0716d1db1fe8 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 24 Jan 2017 13:21:05 +0100 Subject: [PATCH] Utils: Test if vector::operator=(&&) is not throwing exceptions It is advantageous to mark move assignments noexcept. Some implementations are already implementing it and with C++ 17 it will be standard. So we take advantage of it and make it conditionally. Change-Id: I7c6d77d09a02639096ce0fb43733c1fbf190c7c4 Reviewed-by: hjk --- src/libs/utils/smallstringvector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/smallstringvector.h b/src/libs/utils/smallstringvector.h index 5b3701344ec..cc2c102a204 100644 --- a/src/libs/utils/smallstringvector.h +++ b/src/libs/utils/smallstringvector.h @@ -76,7 +76,8 @@ public: BasicSmallStringVector &operator=(const BasicSmallStringVector &) = default; BasicSmallStringVector(BasicSmallStringVector &&) noexcept = default; - BasicSmallStringVector &operator=(BasicSmallStringVector &&) = default; + BasicSmallStringVector &operator=(BasicSmallStringVector &&) + noexcept(std::is_nothrow_move_assignable::value) = default; SmallString join(SmallString &&separator) const {