Иметь этот рабочий код:
template < class... Objects >
static void callNotifyOnPointerObjects ( Objects&&... objects )
{
int arr[] = { 0, ( static_cast< void > ( objects->Notify () ), 0 )... };
static_cast< void > ( arr );
}
objects->Notify()
возвращаемое значение равно bool
Как я могу поместить в массив bool возвращаемые значения, полученные при выполнении objects->Notify()
и проверьте, все ли значения true
:
template < class... Objects >
static bool callNotifyOnPointerObjects ( Objects&&... objects )
{
// Put in this array return values from objects->Notify () execution
bool rc [sizeof...(objects)] = {false};
int arr[] = { 0, ( static_cast< void > ( objects->Notify () ), 0 )... };
static_cast< void > ( arr );
// check if all values in rc == true and return true or false
// return result;
}