Skip to content

Commit 6461094

Browse files
committed
Modified etl::is_delegate to inherit from etl::bool_constant
1 parent 71b691f commit 6461094

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

include/etl/private/delegate_cpp03.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,8 @@ namespace etl
180180
/// is_delegate
181181
//***************************************************************************
182182
template <typename T>
183-
struct is_delegate
183+
struct is_delegate : etl::bool_constant<etl::is_base_of<delegate_tag, T>::value>
184184
{
185-
static const bool value = etl::is_base_of<delegate_tag, T>::value;
186185
};
187186

188187
//*************************************************************************
@@ -192,7 +191,8 @@ namespace etl
192191
class delegate;
193192

194193
template <typename TReturn, typename TParam>
195-
class delegate<TReturn(TParam)> : public private_delegate::call_if_impl<delegate<TReturn(TParam)>, TReturn, TParam>, public delegate_tag
194+
class delegate<TReturn(TParam)> : public private_delegate::call_if_impl<delegate<TReturn(TParam)>, TReturn, TParam>,
195+
public delegate_tag
196196
{
197197
private:
198198

include/etl/private/delegate_cpp11.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,13 @@ namespace etl
9595
/// is_delegate
9696
//***************************************************************************
9797
template <typename T>
98-
struct is_delegate
98+
struct is_delegate : etl::bool_constant<etl::is_base_of<delegate_tag, T>::value>
9999
{
100-
static constexpr bool value = etl::is_base_of<delegate_tag, T>::value;
101100
};
102101

103102
#if ETL_USING_CPP17
104-
105103
template <typename T>
106104
inline constexpr bool is_delegate_v = is_delegate<T>::value;
107-
108105
#endif
109106

110107
//*************************************************************************

0 commit comments

Comments
 (0)