as a non-default, non-noexcept move ctor is ignored by
stl containers.
See clang-tidy's performance-noexcept-move-constructor
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
*/
class PGLockWrapper {
public:
- explicit PGLockWrapper(PGRef locked_pg) : m_pg{locked_pg} {}
+ template <typename A_PG_REF>
+ explicit PGLockWrapper(A_PG_REF&& locked_pg)
+ : m_pg{std::forward<A_PG_REF>(locked_pg)}
+ {}
PGRef pg() { return m_pg; }
~PGLockWrapper();
- PGLockWrapper(PGLockWrapper&& rhs) : m_pg(std::move(rhs.m_pg)) {
+ PGLockWrapper(PGLockWrapper&& rhs) noexcept : m_pg(std::move(rhs.m_pg)) {
rhs.m_pg = nullptr;
}
PGLockWrapper(const PGLockWrapper& rhs) = delete;