diff --git a/include/etl/private/delegate_cpp11.h b/include/etl/private/delegate_cpp11.h index b5a91291..7e79fdd4 100644 --- a/include/etl/private/delegate_cpp11.h +++ b/include/etl/private/delegate_cpp11.h @@ -121,6 +121,7 @@ namespace etl /// Create from function (Compile time). //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create() { return delegate(ETL_NULLPTR, function_stub); @@ -130,6 +131,7 @@ namespace etl /// Create from Lambda or Functor. //************************************************************************* template ::value, void>> + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create(const TLambda& instance) { return delegate((void*)(&instance), lambda_stub); @@ -139,6 +141,7 @@ namespace etl /// Create from instance method (Run time). //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create(T& instance) { return delegate((void*)(&instance), method_stub); @@ -149,12 +152,14 @@ namespace etl /// Deleted for rvalue references. //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create(T&& instance) = delete; //************************************************************************* /// Create from const instance method (Run time). //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create(const T& instance) { return delegate((void*)(&instance), const_method_stub); @@ -170,6 +175,7 @@ namespace etl /// Create from instance method (Compile time). //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create() { return delegate(method_instance_stub); @@ -179,6 +185,7 @@ namespace etl /// Create from const instance method (Compile time). //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create() { return delegate(const_method_instance_stub); @@ -244,6 +251,7 @@ namespace etl /// At the time of writing, GCC appears to have trouble with this. //************************************************************************* template + ETL_NODISCARD static ETL_CONSTEXPR14 delegate create() { return delegate(operator_instance_stub); @@ -365,6 +373,7 @@ namespace etl //************************************************************************* /// Returns true if the delegate is valid. //************************************************************************* + ETL_NODISCARD ETL_CONSTEXPR14 bool is_valid() const { return invocation.stub != ETL_NULLPTR;