@@ -120,7 +120,10 @@ namespace etl
120
120
{
121
121
for (const slot_type& s : *this )
122
122
{
123
- call (s, etl::forward<TArgs>(args)...);
123
+ if (valid (s))
124
+ {
125
+ s (etl::forward<TArgs>(args)...);
126
+ }
124
127
}
125
128
}
126
129
@@ -220,23 +223,25 @@ namespace etl
220
223
iterator end_of_list;
221
224
222
225
// *************************************************************************
223
- // / For a delegate slot type, use call_if .
226
+ // / For a delegate slot type.
224
227
// *************************************************************************
225
228
template <typename TSlotType, typename ... TArgs>
226
- typename etl::enable_if_t <etl::is_delegate<TSlotType>::value, void >
227
- call (const TSlotType& s, TArgs&&... args) const
229
+ static
230
+ typename etl::enable_if_t <etl::is_delegate<TSlotType>::value, bool >
231
+ valid (const TSlotType& s)
228
232
{
229
- s. call_if (etl::forward<TArgs>(args)... );
233
+ return s. is_valid ( );
230
234
}
231
235
232
236
// *************************************************************************
233
- // / For a non-delegate slot type, just call the slot .
237
+ // / For a non-delegate slot type.
234
238
// *************************************************************************
235
239
template <typename TSlotType, typename ... TArgs>
236
- typename etl::enable_if_t <!etl::is_delegate<TSlotType>::value, void >
237
- call (const TSlotType& s, TArgs&&... args) const
240
+ static
241
+ typename etl::enable_if_t <!etl::is_delegate<TSlotType>::value, bool >
242
+ valid (const TSlotType& s, TArgs&&... args)
238
243
{
239
- s (etl::forward<TArgs>(args)...) ;
244
+ return true ;
240
245
}
241
246
242
247
// *************************************************************************
0 commit comments