Added static assert for variadic constructor

Fixed missing this-> prefix for current_size
This commit is contained in:
John Wellbelove 2025-03-02 10:20:44 +00:00
parent 24b241e10a
commit ec08fe48df
2 changed files with 6 additions and 2 deletions

View File

@ -632,6 +632,8 @@ namespace etl
template <typename... TLinks>
intrusive_forward_list(link_type& first, TLinks&... links)
{
ETL_STATIC_ASSERT((etl::is_base_of_all<link_type, TLinks...>::value), "Mixed link types");
this->current_size = 0;
this->start.etl_next = &first;
link_type* last = make_linked_list(this->current_size, first, static_cast<link_type&>(links)...);

View File

@ -692,9 +692,11 @@ namespace etl
template <typename... TLinks>
intrusive_list(link_type& first, TLinks&... links)
{
current_size = 0;
ETL_STATIC_ASSERT((etl::is_base_of_all<link_type, TLinks...>::value), "Mixed link types");
this->current_size = 0;
this->terminal_link.etl_next = &first;
link_type* last = make_linked_list(current_size, first, static_cast<link_type&>(links)...);
link_type* last = make_linked_list(this->current_size, first, static_cast<link_type&>(links)...);
first.etl_previous = &this->terminal_link;
last->etl_next = &this->terminal_link;
this->terminal_link.etl_previous = last;