@@ -475,6 +475,7 @@ namespace etl
475
475
// *************************************************************************
476
476
// / Checks equality.
477
477
// *************************************************************************
478
+ ETL_NODISCARD
478
479
ETL_CONSTEXPR14 bool operator == (const delegate& rhs) const
479
480
{
480
481
return invocation == rhs.invocation ;
@@ -500,6 +501,7 @@ namespace etl
500
501
// *************************************************************************
501
502
// / Returns <b>true</b> if the delegate is valid.
502
503
// *************************************************************************
504
+ ETL_NODISCARD
503
505
ETL_CONSTEXPR14 operator bool () const
504
506
{
505
507
return is_valid ();
@@ -712,6 +714,7 @@ namespace etl
712
714
// / Make a delegate from a free function.
713
715
// *************************************************************************
714
716
template <auto Function>
717
+ ETL_NODISCARD
715
718
constexpr auto make_delegate () ETL_NOEXCEPT
716
719
{
717
720
using function_type = typename etl::private_delegate::function_traits<decltype (Function)>::function_type;
@@ -723,6 +726,7 @@ namespace etl
723
726
// / Make a delegate from a functor or lambda function.
724
727
// *************************************************************************
725
728
template <typename TLambda, typename = etl::enable_if_t <etl::is_class<TLambda>::value, void >>
729
+ ETL_NODISCARD
726
730
constexpr auto make_delegate (TLambda& instance) ETL_NOEXCEPT
727
731
{
728
732
using function_type = typename etl::private_delegate::function_traits<decltype (&TLambda::operator ())>::function_type;
@@ -734,6 +738,7 @@ namespace etl
734
738
// / Make a delegate from a functor, compile time.
735
739
// *************************************************************************
736
740
template <typename T, T& Instance>
741
+ ETL_NODISCARD
737
742
constexpr auto make_delegate () ETL_NOEXCEPT
738
743
{
739
744
using function_type = typename etl::private_delegate::function_traits<decltype (&T::operator ())>::function_type;
@@ -745,6 +750,7 @@ namespace etl
745
750
// / Make a delegate from a member function at compile time.
746
751
// *************************************************************************
747
752
template <typename T, auto Method, T& Instance, typename = etl::enable_if_t <!private_delegate::function_traits<decltype (Method)>::is_const>>
753
+ ETL_NODISCARD
748
754
constexpr auto make_delegate () ETL_NOEXCEPT
749
755
{
750
756
using function_type = typename etl::private_delegate::function_traits<decltype (Method)>::function_type;
@@ -756,6 +762,7 @@ namespace etl
756
762
// / Make a delegate from a const member function at compile time.
757
763
// *************************************************************************
758
764
template <typename T, auto Method, const T& Instance, typename = etl::enable_if_t <private_delegate::function_traits<decltype (Method)>::is_const>>
765
+ ETL_NODISCARD
759
766
constexpr auto make_delegate () ETL_NOEXCEPT
760
767
{
761
768
using function_type = typename etl::private_delegate::function_traits<decltype (Method)>::function_type;
@@ -767,6 +774,7 @@ namespace etl
767
774
// / Make a delegate from a member function at run time.
768
775
// *************************************************************************
769
776
template <typename T, auto Method>
777
+ ETL_NODISCARD
770
778
constexpr auto make_delegate (T& instance) ETL_NOEXCEPT
771
779
{
772
780
using function_type = typename etl::private_delegate::function_traits<decltype (Method)>::function_type;
@@ -778,6 +786,7 @@ namespace etl
778
786
// / Make a delegate from a member function at run time.
779
787
// *************************************************************************
780
788
template <typename T, auto Method>
789
+ ETL_NODISCARD
781
790
constexpr auto make_delegate (const T& instance) ETL_NOEXCEPT
782
791
{
783
792
using function_type = typename etl::private_delegate::function_traits<decltype (Method)>::function_type;
0 commit comments