From dd4d0088c512345996f3571bc28c67bcc36aac51 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 4 Feb 2025 14:05:11 +0000 Subject: [PATCH] Added ETL_NODISCARD to make_delegete functions --- include/etl/private/delegate_cpp11.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/etl/private/delegate_cpp11.h b/include/etl/private/delegate_cpp11.h index 6ced9c954..e1f7c3969 100644 --- a/include/etl/private/delegate_cpp11.h +++ b/include/etl/private/delegate_cpp11.h @@ -475,6 +475,7 @@ namespace etl //************************************************************************* /// Checks equality. //************************************************************************* + ETL_NODISCARD ETL_CONSTEXPR14 bool operator == (const delegate& rhs) const { return invocation == rhs.invocation; @@ -500,6 +501,7 @@ namespace etl //************************************************************************* /// Returns true if the delegate is valid. //************************************************************************* + ETL_NODISCARD ETL_CONSTEXPR14 operator bool() const { return is_valid(); @@ -712,6 +714,7 @@ namespace etl /// Make a delegate from a free function. //************************************************************************* template + ETL_NODISCARD constexpr auto make_delegate() ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type; @@ -723,6 +726,7 @@ namespace etl /// Make a delegate from a functor or lambda function. //************************************************************************* template ::value, void>> + ETL_NODISCARD constexpr auto make_delegate(TLambda& instance) ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type; @@ -734,6 +738,7 @@ namespace etl /// Make a delegate from a functor, compile time. //************************************************************************* template + ETL_NODISCARD constexpr auto make_delegate() ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type; @@ -745,6 +750,7 @@ namespace etl /// Make a delegate from a member function at compile time. //************************************************************************* template ::is_const>> + ETL_NODISCARD constexpr auto make_delegate() ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type; @@ -756,6 +762,7 @@ namespace etl /// Make a delegate from a const member function at compile time. //************************************************************************* template ::is_const>> + ETL_NODISCARD constexpr auto make_delegate() ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type; @@ -767,6 +774,7 @@ namespace etl /// Make a delegate from a member function at run time. //************************************************************************* template + ETL_NODISCARD constexpr auto make_delegate(T& instance) ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type; @@ -778,6 +786,7 @@ namespace etl /// Make a delegate from a member function at run time. //************************************************************************* template + ETL_NODISCARD constexpr auto make_delegate(const T& instance) ETL_NOEXCEPT { using function_type = typename etl::private_delegate::function_traits::function_type;