diff --git a/src/ivector.h b/src/ivector.h index 2ed64e8b..0dfe8491 100644 --- a/src/ivector.h +++ b/src/ivector.h @@ -424,9 +424,10 @@ namespace etl // The unused branch should be optimised away. if (is_simple_type::value) { - for (size_t current_size = 0; current_size < n; ++current_size) + while (n > 0) { - p_buffer[current_size] = value; + p_buffer[current_size++] = value; + --n; } } else @@ -600,6 +601,7 @@ namespace etl size_t to = from + n_insert; size_t n_move = std::distance(position, end()); size_t n_create_copy = std::min(n_insert, n_move); + for (size_t i = 0; i < n_create_copy; ++i) { p_buffer[to--] = p_buffer[from--]; @@ -899,7 +901,7 @@ namespace etl } } -//#include "ivectorpointer.h" +#include "private/ivectorpointer.h" #undef __ETL_IN_IVECTOR_H__ #endif diff --git a/src/vector.h b/src/vector.h index 73ada799..86a4998e 100644 --- a/src/vector.h +++ b/src/vector.h @@ -151,7 +151,7 @@ namespace etl /// Constructor. //************************************************************************* vector() - : ivector(reinterpret_cast(&buffer), MAX_SIZE) + : ivector(reinterpret_cast(&buffer), MAX_SIZE) { ivector::initialise(); } @@ -161,7 +161,7 @@ namespace etl ///\param initial_size The initial size of the vector. //************************************************************************* explicit vector(size_t initial_size) - : ivector(reinterpret_cast(&buffer), MAX_SIZE) + : ivector(reinterpret_cast(&buffer), MAX_SIZE) { ivector::initialise(); ivector::resize(initial_size); @@ -173,7 +173,7 @@ namespace etl ///\param value The value to fill the vector with. //************************************************************************* vector(size_t initial_size, typename ivector::parameter_t value) - : ivector(reinterpret_cast(&buffer), MAX_SIZE) + : ivector(reinterpret_cast(&buffer), MAX_SIZE) { ivector::initialise(); ivector::resize(initial_size, value); @@ -187,7 +187,7 @@ namespace etl //************************************************************************* template vector(TIterator first, TIterator last) - : ivector(reinterpret_cast(&buffer), MAX_SIZE) + : ivector(reinterpret_cast(&buffer), MAX_SIZE) { ivector::assign(first, last); } @@ -196,7 +196,7 @@ namespace etl /// Copy constructor. //************************************************************************* vector(const vector& other) - : ivector(reinterpret_cast(&buffer), MAX_SIZE) + : ivector(reinterpret_cast(&buffer), MAX_SIZE) { ivector::assign(other.begin(), other.end()); } @@ -216,7 +216,7 @@ namespace etl private: - typename etl::aligned_storage::value>::type buffer; + typename etl::aligned_storage::value>::type buffer; }; } diff --git a/test/vs2015/etl.vcxproj b/test/vs2015/etl.vcxproj index e6d4f20f..73302c5e 100644 --- a/test/vs2015/etl.vcxproj +++ b/test/vs2015/etl.vcxproj @@ -221,6 +221,7 @@ + @@ -256,6 +257,7 @@ + @@ -271,6 +273,7 @@ + diff --git a/test/vs2015/etl.vcxproj.filters b/test/vs2015/etl.vcxproj.filters index e1540255..0c2e2e1b 100644 --- a/test/vs2015/etl.vcxproj.filters +++ b/test/vs2015/etl.vcxproj.filters @@ -510,6 +510,15 @@ ETL\Containers + + ETL\Containers + + + ETL\Private + + + ETL\Utilities +