diff --git a/include/etl/circular_buffer.h b/include/etl/circular_buffer.h index 3f9710d1..d20b082a 100644 --- a/include/etl/circular_buffer.h +++ b/include/etl/circular_buffer.h @@ -1051,7 +1051,7 @@ namespace etl { public: - ETL_STATIC_ASSERT((MAX_SIZE_ > 0U), "Zero sized etl::circular_buffer is not valid. Did you mean circular_buffer_ext?"); + ETL_STATIC_ASSERT((MAX_SIZE_ > 0U), "Zero sized etl::circular_buffer is not valid"); static ETL_CONSTANT typename icircular_buffer::size_type MAX_SIZE = typename icircular_buffer::size_type(MAX_SIZE_); diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index 4c6b9c22..38dd8063 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -1624,6 +1624,8 @@ namespace etl { public: + ETL_STATIC_ASSERT((MAX_SIZE_ > 0U), "Zero sized etl::forward_list is not valid"); + static const size_t MAX_SIZE = MAX_SIZE_; public: @@ -1748,7 +1750,7 @@ namespace etl ///\note 'merge' and 'splice_after' and are not supported. //************************************************************************* template - class forward_list : public etl::iforward_list + class forward_list_ext : public etl::iforward_list { public: @@ -1764,7 +1766,7 @@ namespace etl //************************************************************************* /// Default constructor. //************************************************************************* - forward_list() + forward_list_ext() : etl::iforward_list(true) { } @@ -1772,7 +1774,7 @@ namespace etl //************************************************************************* /// Default constructor. //************************************************************************* - explicit forward_list(etl::ipool& node_pool) + explicit forward_list_ext(etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->initialise(); @@ -1781,7 +1783,7 @@ namespace etl //************************************************************************* /// Construct from size. //************************************************************************* - explicit forward_list(size_t initial_size, etl::ipool& node_pool) + explicit forward_list_ext(size_t initial_size, etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->assign(initial_size, T()); @@ -1790,7 +1792,7 @@ namespace etl //************************************************************************* /// Construct from size and value. //************************************************************************* - explicit forward_list(size_t initial_size, const T& value, etl::ipool& node_pool) + explicit forward_list_ext(size_t initial_size, const T& value, etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->assign(initial_size, value); @@ -1799,7 +1801,7 @@ namespace etl //************************************************************************* /// Copy constructor. Implicit pool. //************************************************************************* - forward_list(const forward_list& other) + forward_list_ext(const forward_list_ext& other) : etl::iforward_list(*other.p_node_pool, other.p_node_pool->max_size(), true) { this->assign(other.cbegin(), other.cend()); @@ -1808,7 +1810,7 @@ namespace etl //************************************************************************* /// Copy constructor. Explicit pool. //************************************************************************* - forward_list(const forward_list& other, etl::ipool& node_pool) + forward_list_ext(const forward_list_ext& other, etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->assign(other.cbegin(), other.cend()); @@ -1818,7 +1820,7 @@ namespace etl //************************************************************************* /// Move constructor. Implicit pool //************************************************************************* - forward_list(forward_list&& other) + forward_list_ext(forward_list_ext&& other) : etl::iforward_list(*other.p_node_pool, other.p_node_pool->max_size(), true) { this->move_container(std::move(other)); @@ -1827,7 +1829,7 @@ namespace etl //************************************************************************* /// Move constructor. Explicit pool //************************************************************************* - forward_list(forward_list&& other, etl::ipool& node_pool) + forward_list_ext(forward_list_ext&& other, etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->move_container(std::move(other)); @@ -1838,7 +1840,7 @@ namespace etl /// Construct from range. //************************************************************************* template - forward_list(TIterator first, TIterator last, etl::ipool& node_pool) + forward_list_ext(TIterator first, TIterator last, etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->assign(first, last); @@ -1848,7 +1850,7 @@ namespace etl //************************************************************************* /// Construct from initializer_list. //************************************************************************* - forward_list(std::initializer_list init, etl::ipool& node_pool) + forward_list_ext(std::initializer_list init, etl::ipool& node_pool) : etl::iforward_list(node_pool, node_pool.max_size(), true) { this->assign(init.begin(), init.end()); @@ -1858,7 +1860,7 @@ namespace etl //************************************************************************* /// Destructor. //************************************************************************* - ~forward_list() + ~forward_list_ext() { this->initialise(); } @@ -1866,7 +1868,7 @@ namespace etl //************************************************************************* /// Assignment operator. //************************************************************************* - forward_list& operator = (const forward_list& rhs) + forward_list_ext& operator = (const forward_list_ext& rhs) { if (&rhs != this) { @@ -1880,7 +1882,7 @@ namespace etl //************************************************************************* /// Move assignment operator. //************************************************************************* - forward_list& operator = (forward_list&& rhs) + forward_list_ext& operator = (forward_list_ext&& rhs) { this->move_container(etl::move(rhs)); diff --git a/test/test_forward_list_shared_pool.cpp b/test/test_forward_list_shared_pool.cpp index 39873f21..0107f3ac 100644 --- a/test/test_forward_list_shared_pool.cpp +++ b/test/test_forward_list_shared_pool.cpp @@ -50,11 +50,11 @@ namespace typedef TestDataDC ItemDC; typedef TestDataNDC ItemNDC; - typedef etl::forward_list DataDC; - typedef etl::forward_list DataNDC; + typedef etl::forward_list_ext DataDC; + typedef etl::forward_list_ext DataNDC; typedef etl::iforward_list IDataNDC; - typedef etl::forward_list DataInt; + typedef etl::forward_list_ext DataInt; typedef std::forward_list CompareDataDC; typedef std::forward_list CompareDataNDC;