mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Added type_list definitions for nth_type and observer
This commit is contained in:
parent
01a0b63919
commit
682b1e7011
@ -58,14 +58,16 @@ namespace etl
|
||||
{
|
||||
ETL_STATIC_ASSERT(Index < sizeof...(TTypes), "etl::nth_type index 'Index' out of bounds");
|
||||
|
||||
using type = typename private_nth_type::nth_type_helper<Index, TTypes...>::type;
|
||||
using type = typename private_nth_type::nth_type_helper<Index, TTypes...>::type;
|
||||
using type_list = etl::type_list<TTypes...>;
|
||||
};
|
||||
|
||||
//***********************************
|
||||
template <size_t Index, typename... TTypes>
|
||||
struct nth_type<Index, etl::type_list<TTypes...>> : public nth_type<Index, TTypes...>
|
||||
struct nth_type<Index, etl::type_list<TTypes...>>
|
||||
{
|
||||
using typename nth_type<Index, TTypes...>::type;
|
||||
using type = typename nth_type<Index, TTypes...>::type;
|
||||
using type_list = typename nth_type<Index, TTypes...>::type_list;
|
||||
};
|
||||
|
||||
//***********************************
|
||||
|
||||
@ -309,6 +309,7 @@ namespace etl
|
||||
|
||||
using observer<T1>::notification;
|
||||
using observer<TRest...>::notification;
|
||||
using type_list = etl::type_list<T1, TRest...>;
|
||||
};
|
||||
|
||||
//*****************************************************************
|
||||
@ -323,6 +324,8 @@ namespace etl
|
||||
virtual ~observer() = default;
|
||||
|
||||
virtual void notification(T1) = 0;
|
||||
|
||||
using type_list = etl::type_list<T1>;
|
||||
};
|
||||
|
||||
//*****************************************************************
|
||||
@ -337,6 +340,8 @@ namespace etl
|
||||
virtual ~observer() = default;
|
||||
|
||||
virtual void notification() = 0;
|
||||
|
||||
using type_list = etl::type_list<>;
|
||||
};
|
||||
|
||||
//*****************************************************************
|
||||
@ -350,6 +355,7 @@ namespace etl
|
||||
public:
|
||||
|
||||
using observer<TTypes...>::notification;
|
||||
using type_list = etl::type_list<TTypes...>;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user