Skip to content

Commit

Permalink
Refs 12400. Fixed rvalue version of ResourceLimitedVector::insert.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Dec 20, 2021
1 parent 0c9a2ea commit 237fd2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/fastrtps/utils/collections/ResourceLimitedVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ class ResourceLimitedVector
const_iterator pos,
value_type&& value)
{
auto dist = std::distance(collection_.cbegin(), pos);
if (!ensure_capacity())
{
return end();
}

return collection_.insert(pos, std::move(value));
return collection_.insert(collection_.cbegin() + dist, std::move(value));
}

/**
Expand Down

0 comments on commit 237fd2b

Please sign in to comment.