Merge remote-tracking branch 'origin/hotfix/vector_move_bug' into development

# Conflicts:
#	include/etl/version.h
#	support/Release notes.txt
This commit is contained in:
John Wellbelove 2019-05-24 23:10:56 +01:00
commit 2f19a9cf3c
4 changed files with 43 additions and 3 deletions

View File

@ -435,6 +435,24 @@ namespace etl
: pvoidvector(reinterpret_cast<void**>(p_buffer_), MAX_SIZE_)
{
}
//*********************************************************************
/// Initialise the source vector after a move.
//*********************************************************************
void initialise_source_external_buffer_after_move()
{
ETL_SUBTRACT_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end)))
p_end = p_buffer;
}
//*********************************************************************
/// Initialise the destination vector after a move.
//*********************************************************************
void initialise_destination_external_buffer_after_move()
{
ETL_ADD_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end)))
}
};
template <typename T>
@ -828,6 +846,24 @@ namespace etl
: pvoidvector(reinterpret_cast<void**>(const_cast<T**>(p_buffer_)), MAX_SIZE_)
{
}
//*********************************************************************
/// Initialise the source vector after a move.
//*********************************************************************
void initialise_source_external_buffer_after_move()
{
ETL_SUBTRACT_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end)))
p_end = p_buffer;
}
//*********************************************************************
/// Initialise the destination vector after a move.
//*********************************************************************
void initialise_destination_external_buffer_after_move()
{
ETL_ADD_DEBUG_COUNT(int32_t(std::distance(p_buffer, p_end)))
}
};
//***************************************************************************

View File

@ -1555,7 +1555,7 @@ namespace etl
{
this->initialise();
typename etl::ivector<T>::iterator itr = other.begin();
typename etl::ivector<T*>::iterator itr = other.begin();
while (itr != other.end())
{
this->push_back(std::move(*itr));
@ -1574,7 +1574,7 @@ namespace etl
if (&rhs != this)
{
this->clear();
typename etl::ivector<T>::iterator itr = rhs.begin();
typename etl::ivector<T*>::iterator itr = rhs.begin();
while (itr != rhs.end())
{
this->push_back(std::move(*itr));

View File

@ -39,7 +39,7 @@ SOFTWARE.
#define ETL_VERSION_MAJOR 14
#define ETL_VERSION_MINOR 24
#define ETL_VERSION_PATCH 1
#define ETL_VERSION_PATCH 2
#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.24.2
Fixed bug in 'vector of pointers' move constructor.
===============================================================================
14.24.1
Added compile time functor version of 'create()'.