From 32e8134ca44272565c454e7a145938ca23488600 Mon Sep 17 00:00:00 2001 From: Steffen Zimmermann Date: Mon, 15 Nov 2021 12:02:02 +0100 Subject: [PATCH] harmonize copy ctor and asignment op for etl::delegate (#465) etl::delegate has a user-written copy constructor and a defaulted assignment operator. The copy constructor does the same as a defaulted copy constructor, therefore there is no need to add a user-written copy constructor. The combination of user-written copy constructor and defaulted assignment operator causes a warning in Coverity, a static code analyzer: copy_without_assign: Class etl::delegate has a user-written copy constructor etl::delegate::delegate(etl::delegate const &) but no corresponding user-written assignment operator. This commit replaces the user-written copy constructor with a defaulted copy constructor, which does the same. --- include/etl/delegate.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/etl/delegate.h b/include/etl/delegate.h index 49faf477..b8062c45 100644 --- a/include/etl/delegate.h +++ b/include/etl/delegate.h @@ -111,10 +111,7 @@ namespace etl //************************************************************************* // Copy constructor. //************************************************************************* - ETL_CONSTEXPR14 delegate(const delegate& other) - : invocation(other.invocation) - { - } + ETL_CONSTEXPR14 delegate(const delegate& other) = default; //************************************************************************* // Construct from lambda or functor.