Added variadic parameters to observer notification.

This commit is contained in:
John Wellbelove 2019-06-19 20:53:18 +01:00
parent 1163c67cf0
commit 09d96e158e
3 changed files with 17 additions and 1 deletions

View File

@ -176,6 +176,16 @@ namespace etl
///\tparam TNotification the notification type.
///\param n The notification.
//*****************************************************************
#if ETL_CPP11_SUPPORTED && !defined(ETL_OBSERVER_FORCE_CPP03)
template <typename... TNotification>
void notify_observers(TNotification... n)
{
for (auto observer : observer_list)
{
observer->notification(n...);
}
}
#else
template <typename TNotification>
void notify_observers(TNotification n)
{
@ -184,6 +194,8 @@ namespace etl
observer_list[i]->notification(n);
}
}
#endif
protected:

View File

@ -39,7 +39,7 @@ SOFTWARE.
#define ETL_VERSION_MAJOR 14
#define ETL_VERSION_MINOR 26
#define ETL_VERSION_PATCH 5
#define ETL_VERSION_PATCH 6
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH))

View File

@ -1,3 +1,7 @@
===============================================================================
14.26.6
Added variadic parameters to observer notification.
===============================================================================
14.26.5
Fixed misplaced semicolon in error_handler.h