Skip to content

Commit

Permalink
Modified etl::is_delegate to inherit from etl::bool_constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jwellbelove committed Oct 21, 2024
1 parent 71b691f commit 6461094
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/etl/private/delegate_cpp03.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ namespace etl
/// is_delegate
//***************************************************************************
template <typename T>
struct is_delegate
struct is_delegate : etl::bool_constant<etl::is_base_of<delegate_tag, T>::value>
{
static const bool value = etl::is_base_of<delegate_tag, T>::value;
};

//*************************************************************************
Expand All @@ -192,7 +191,8 @@ namespace etl
class delegate;

template <typename TReturn, typename TParam>
class delegate<TReturn(TParam)> : public private_delegate::call_if_impl<delegate<TReturn(TParam)>, TReturn, TParam>, public delegate_tag
class delegate<TReturn(TParam)> : public private_delegate::call_if_impl<delegate<TReturn(TParam)>, TReturn, TParam>,
public delegate_tag
{
private:

Expand Down
5 changes: 1 addition & 4 deletions include/etl/private/delegate_cpp11.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,13 @@ namespace etl
/// is_delegate
//***************************************************************************
template <typename T>
struct is_delegate
struct is_delegate : etl::bool_constant<etl::is_base_of<delegate_tag, T>::value>
{
static constexpr bool value = etl::is_base_of<delegate_tag, T>::value;
};

#if ETL_USING_CPP17

template <typename T>
inline constexpr bool is_delegate_v = is_delegate<T>::value;

#endif

//*************************************************************************
Expand Down

0 comments on commit 6461094

Please sign in to comment.